+2 votes

Hi! i´m looking for some help to know which is the best way to detect when animation reach its end and play another one inside the same animation node?, or to emit a signal when the current playing animation reach its end.

Thanks!

in Engine by (23 points)

2 Answers

+7 votes
Best answer

There is a many ways to play another animation when a animation ends

In editor

enter image description here

Using queue

get_node("AnimationPlayer").queue("New Anim (2)")

Using signal

get_node("AnimationPlayer").connect("finished", self, "do_anim_finished")

or

var anim = get_node("AnimationPlayer")
anim.connect("finished", anim, "play", ["New Anim (2)"])
by (9,782 points)
selected by

Thank you very much! this is what i was looking for.

+5 votes

If you want something to happen on the end of your animation, then you can call functions from animation. That would be the easiest solution, at least I think.

by (154 points)

Thanks a lot!

How exactly this can be done? I haven't seen a way to connect a function with animation directly.

It's over there: enter image description here
After that you just connect it to a node with a script and you can call a func in that script

Thank you very much!

thank you this was useful

Hey i can't attach a script there Could u Help me out?

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 [email protected] with your username.