![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | valegians |
Hi,
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 centre-ed 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 changed 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
–EDIT–
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: Animation player doesn't let update track properties · Issue #74006 · godotengine/godot · GitHub
Thank you
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.
valegians | 2023-03-01 16:51