delay between two functions

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bot7

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?

:bust_in_silhouette: Reply From: Lopy

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)

Thanks. It works.

Bot7 | 2020-12-23 22:49

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

Wakatta | 2020-12-25 14:32