Quick answer: Add a transition from current state to target (or via intermediate states forming a path). Use start(target) for an instant jump if no transition is desired. Cache the playback object via get("parameters/StateMachine/playback") — the path matches your state machine’s name in the AnimationTree.
You call playback.travel("Run") and the console prints “Cannot travel: no path from Idle to Run.” The state machine has no transition between them.
The Symptom
travel() logs “cannot find path,” animation doesn’t change. Or it animates but with no blend (just snaps), suggesting start() was used internally.
The Fix
Add transitions. Open the AnimationTree, double-click the StateMachine node. In the editor, drag from Idle to Run to add a transition. Set Advance Mode (Auto / Disabled / Enabled). Set transition time (0.2s for typical blend).
Use start() for instant.
var sm := animation_tree.get("parameters/StateMachine/playback") as AnimationNodeStateMachinePlayback
func hard_reset() -> void:
sm.start("Idle") # instant, no blend
func begin_run() -> void:
sm.travel("Run") # follows transitions, blends
Cache the Playback
get() with a string path is not free. Cache once in _ready:
@onready var sm: AnimationNodeStateMachinePlayback = animation_tree.get("parameters/StateMachine/playback")
Conditional Transitions
Set Advance Mode = Auto on a transition with an Advance Condition. The state machine moves itself when the condition is true; you don’t need to call travel().
animation_tree.set("parameters/StateMachine/conditions/should_run", true)
Verifying
Open AnimationTree editor with the scene playing. Active state highlights green. Call travel; it should walk to the target. If it stays on current and logs “cannot find path,” the transition graph is missing an edge.
“Connect states. travel for blends. start for instant. Cache playback.”
Related Issues
For Tween callback not firing, see tween callback. For input deadzone, see deadzone.
Path exists. travel works.