0 votes


I'm trying to find out when an Animation in an AnimationTree has finished.

The idea is that when my character attacks I want him to stop moving and only resume moving once the attack animation has finished. In an AnimationPlayer I could use the Signal animation_finished() but this does not exist for the AnimationTree which I am using to control my characters evolving state machine.

I can find out which animation is playing in the AnimationTree using .getcurrentnode() and I can find out if the AnimationTree itself is_playing() an animation but I can't seem to find a way to know when a specific animation in the AnimationTree has finished so that I can then execute some code.

The only thing I can think of is setting a Timer but I was wondering if there was a simpler solution?

Thanks for any help!

in Engine by (15 points)

1 Answer

+1 vote

Thank you! Works a treat!

The issue with this is that you need to make a new track for every animation you want to know that is finished.

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.