Topic was automatically imported from the old Question2Answer platform.
Asked By
MegamanXfangamer
hello everyone! I would like to know how it is that I can make that when an animatedsprite 2d animation ends, another one begins and that it makes a loop or that if I have a key pressed and an animation is playing and as soon as I stop pressing the key another animation without loop begins and as soon as it finishes, the idle animation starts
In the animated sprite if you go to the signals section you will see a signal “Animation_Finished”.
This signal will happen when that animated sprite finishes its animation so you can link this to a function in a script to restart a new animated sprite immediately. when you click on the signal it will prompt you to link it to a function in a script so it isnt too difficult.
You can just link it to a function which restarts a given animation or you could manually emit a signal with the animation name in if you wish, this requires a bit more setup but basically you can do it as below.
For a signal named animation_finished inside an object named anim.
Objects tell anim that they are interested to know when animation_finished happens.