Godot Version
4.5.1 stable
Question
Hello!
I have the following animated sprite, imagine its tail swinging left and right, and possibly biting when needed. This is done through a sprite2D + AnimationPlayer combination and a state tree.
I would like for the shark to be able to
- Bend its “spine” when turning toward something, while continuing its animation (see the following screen).
- The hitbox to be able to match the transformed sprite.
I would like your input on how to achieve that.
Note: I would like to have this framework for different creatures, and thus the hitboxes might be a bit less simple/rectangular. the transform will always be the same.
So far
I have had limited success on bending the sprite while playing ONE animation, the swimming one. I did so by switching to a polygon2D + Skeleton2D and using an animatedSprite2D as texture for the polygon2D, but:
- I can’t see a way to make that support multiple animations
- I also failed to use the resulting transformed sprite to modify the hitbox on the go - i assume this data is calculated thanks to the polygon + bones transforms on the GPU and never leaves it. (i tried the .uv, and .polygon of the Polygon2D, they don’t update)

