A state machine with multiple AnimationRootNodes, used by AnimationTree.
Contains multiple AnimationRootNodes representing animation states, connected in a graph. State transitions can be configured to happen automatically or via code, using a shortest-path algorithm. Retrieve the AnimationNodeStateMachinePlayback object from the AnimationTree node to control it programmatically.
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")If true, allows teleport to the self state with AnimationNodeStateMachinePlayback.travel(). When the reset option is enabled in AnimationNodeStateMachinePlayback.travel(), the animation is restarted. If false, nothing happens on the teleportation to the self state.
If true, treat the cross-fade to the start and end nodes as a blend with the RESET animation.
In most cases, when additional cross-fades are performed in the parent AnimationNode of the state machine, setting this property to false and matching the cross-fade time of the parent AnimationNode and the state machine's start node and end node gives good results.
This property can define the process of transitions for different use cases. See also StateMachineType.
Adds a transition between the given animation nodes.
Returns a list containing the names of all animation nodes in this state machine.
STATE_MACHINE_TYPE_ROOT = 0Seeking to the beginning is treated as playing from the start state. Transition to the end state is treated as exiting the state machine.
STATE_MACHINE_TYPE_NESTED = 1Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine.
STATE_MACHINE_TYPE_GROUPED = 2This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with state_machine_type of STATE_MACHINE_TYPE_ROOT or STATE_MACHINE_TYPE_NESTED in the parent or ancestor.