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.
Example:
STATE_MACHINE_TYPE_ROOT = 0
Seeking 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 = 1
Seeking 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 = 2
This 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.
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 new animation node to the graph. The position
is used for display in the editor.
Adds a transition between the given animation nodes.
Returns the draw offset of the graph. Used for display in the editor.
Returns the animation node with the given name.
Returns the given animation node's name.
Returns the given animation node's coordinates. Used for display in the editor.
Returns the given transition.
Returns the number of connections in the graph.
Returns the given transition's start node.
Returns the given transition's end node.
Returns true
if the graph contains the given animation node.
Returns true
if there is a transition between the given animation nodes.
Deletes the given animation node from the graph.
Deletes the transition between the two specified animation nodes.
Deletes the given transition by index.
Renames the given animation node.
Replaces the given animation node with a new animation node.
Sets the draw offset of the graph. Used for display in the editor.
Sets the animation node's coordinates. Used for display in the editor.