0 votes

I want make a Animation and when its finished a other Animation should play, but I dont want to use a Timer. How does it work?

Godot version 3.2.2
in Engine by (254 points)

1 Answer

+3 votes
Best answer

AnimationPlayer has a signal called animation_finished. It will emit this signal automatically when any animation finishes.

In a _ready() somewhere, you can connect the signal to a function that will start the next animation. Something like this :
. $anim.connect("animation_finished", self, "next_animation")
func next_animation(_animation_name):
. pass
(with $anim representing your AnimationPlayer)

by (2,276 points)
selected by

Thanks. It works.

Animations can also call functions of nodes. Just an FYI for more control

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 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.