All Questions


Dominik Waurenschk
posted to: The Spawn State

Animation Tree finished signal?


so you're waiting for the Animation Player to finish playing it's animation, then transition to the next state.

I'm using an AnimationTree instead, how can I achive the same? Connecting to the AnimationPlayer the AnimationTree uses does not work, the signal is not emitted. And the AnimationTree itself does not have signals at all.

Have I overlooked something, or do I need to code some hack to make it happen?

Using Godot 3.2.2 btw :)

Thank you!

  • Nathan Lovato replied

    The animation tree is designed in such a way it's meant to be controlled from the outside. I haven't used it extensively but for the 3D Mannequin, what we do is we have a public method that controls the animated character from a parent node. Like so:

    onready var animation_tree: AnimationTree = $AnimationTreeonready
    var _playback: AnimationNodeStateMachinePlayback = animation_tree["parameters/playback"]
    func transition_to(state_id: int) -> void:
        match state_id:		

    When you call travel() on an animation tree like so, it will still respect each node's settings, like having to wait until the animation ends before moving on. In a sense, this function sets the target node you want to reach in the tree.

    Otherwise, the animation tree only controls an AnimationPlayer, so you can still connect to that player's animation_changed and animation_finished signals. But I would rather define a function like above.

  • W
    Dominik Waurenschk replied

    Thanks for the answer.

    I have a signal that my state machine emits, and my AnimationTree then does the travel() like in your function.

    My problem is that the AnimationPlayer does not emit the "animation_finished" signal when controlled by an AnimationTree. So I get stuck in spawn state.

  • Nathan Lovato replied

    The animation player will only emit animation finished when an animation finished playing. If it's looping or changing before the end, you may want to use animation_changed instead. In either case, I would recommend avoiding using the animation player's signals and controlling the animation from the state machine, as much as you can.