0
\$\begingroup\$

I am trying to rotate a sword hitbox around the player depending on which animation is currently playing.

I have the following node setup:

Scene
|---AnimationPlayer
|---Marker2D
.....|---Area2D
..........|---CollisionShape2D

The CollisionShape2D is for the shape of the hitbox. The Marker 2D is centred on the player, and I want to use its rotation property to rotate the hitbox around the player.

So I go to my AnimationPlayer node, select an animation and key the rotation property at the start of the animation.

The issue is that once I have keyed rotation to the first animation, the rotation property becomes "locked" and I cannot change its value anymore.

Is this intended behaviour and I am missing something obvious? Or is this a bug?

I am using Godot version 4.0.beta16

\$\endgroup\$
1
  • \$\begingroup\$ This seems to happen if the Update mode for the animation track of the Marker2D rotation property is set to continuous. If I change the Update mode to discreet then this issue disappears. \$\endgroup\$
    – valegians
    Commented Mar 1, 2023 at 16:51

1 Answer 1

1
\$\begingroup\$

This is caused by having an AnimationTree set to Active. Deactivate the tree and the issue disappears.

Alternatively, change the update mode of the animation track to discreet (from continuous) then this issue also disappears.

See: https://github.com/godotengine/godot/issues/74006

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .