So currently I am using the following code to play my sprites (AnimatedSprite Node).

$Sprite.play("Animation Name")

However now I want to use the AnimationPlayer Node to play my sprites. How can I do this? I have searched the docs and there is no tutorial and I have searched online but they have to use AnimationTree or a sprite sheet which I don't have. (I have individual sprites).

So my question is how can I use the AnimationPlayer Node in the same way as AnimatedSprite Node.

Note: The reason I am using AnimationPlayer instead of AnimatedSprite because I would like to change collisions during certain frames, but that's for another time.

Disclaimer: To prevent false answers I don't have a sprite sheet. I have individual sprites


The godot docs have a whole section on just this.

To summarize:

  1. Just use a regular Sprite instead of AnimatedSprite
  2. Set the texture to your spritesheet
  3. Set hframes/vframes to tell the Sprite how to divide up your spritesheet
  4. Add keyframes for the Frame property of the Sprite to the AnimationPlayer
  • \$\begingroup\$ As clearly stated in my question I don’t have a sprite sheet. \$\endgroup\$ Oct 18 '19 at 7:19

Found the answer. In Animation Player I just needed to add keys for each frame from my AnimatedSprite Node. Then I would also need to add an animation key to trigger the animation. Hope this helped anyone in the same situation as me. I changed collision by adding keys to change the shape of the collision shape.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.