0 votes

I am new to Godot and trying to learn how to use AnimatedSprite.

I have gone through the step-by-step tutorial that shows the use of AnimationPlayer (http://docs.godotengine.org/en/stable/tutorials/step_by_step/animations.html).

I have also used the following tutorial that shows using a script on an AnimatedSprite to cycle through the images: http://www.gamefromscratch.com/post/2015/06/03/Godot-Engine-Tutorial-Part-9-Sprite-Animation.aspx

Then, while editing the animation frames, I also noticed that there are settings for creating animations where you can specify the speed, which led me to believe that this could possibly be an automatic thing (see screenshot). However, this by itself seems to do nothing when playing the scene.

Which of these approaches is the correct / default / simplest?

enter image description here

in Engine by (114 points)

1 Answer

+2 votes
Best answer

Never mind. I have just found what I was looking for.

In the Inspector tab on the AnimatedSprite, there is a property called "Playing". When set, this causes the animation to flow. And I see now that there is a property called "Animation" which specifies the current animation being played, so you can obviously switch it with code, which is brilliant!

enter image description here

by (114 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.