How to animate 2D hitboxes and hurtboxes?

Godot Version

v4.0 stable

Question

It’s easy to create an animated sprite for a characterbody2D. However, the collision shape is static. How can I animate a collision shape (for example, a hitbox that swings with a sword)?

I’m working on a fighting game. These require many overlapping and moving detection regions.

Hey there,

you could use the AnimationPlayer. There you can animate , rotate and scale objects. You can either enable or disable hitboxes. Give it a try :wink:

1 Like