AnimationTree state machine not playing for several steps

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By noPain_noGame

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!

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)

davidoc | 2020-03-15 16:17