+2 votes

I am trying to use the AnimationNodeStateMachine in the AnimationTree in my Player node.

However, I am keep getting errors that the state machine is not playing. (ERROR: Can't travel to 'Falling' if state machine is not playing.)

I found out with the is_playing() method that for the first several steps(like 7~8 steps), it return false then it returns true afterwards.

I currently made a temporary solution that the player should not proceed the process if the state_machine is not playing (see the last two codes below), which seems to work for now.

var state_machine

func _ready():
    state_machine = $AnimationTree.get("parameters/playback")
    state_machine.start("Run")
    $AnimationTree.active = true

func _physics_process(delta):
    #Added the below code and it starts working
    if(state_machine.is_playing() == false):
        return

Will there be a better solution for this situation, since mine doesn't look like a good one?

Thanks!

in Engine by (14 points)

Do AnimationTree process mode is set to Physics?
Also try setting your RUN node as the start node in the editor (the icon next to the trash icon)

Please log in or register to answer this question.

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.