A state machine with multiple [AnimationRootNode]s, used by [AnimationTree].
Contains multiple [AnimationRootNode]s 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.
[b]Example:[/b]
[codeblocks]
[gdscript]
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
[/gdscript]
[csharp]
var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
stateMachine.Travel("some_state");
[/csharp]
[/codeblocks]
$DOCS_URL/tutorials/animation/animation_tree.html
Adds a new animation node to the graph. The [param 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 [code]true[/code] if the graph contains the given animation node.
Returns [code]true[/code] 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.
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.
If [code]true[/code], allows teleport to the self state with [method AnimationNodeStateMachinePlayback.travel]. When the reset option is enabled in [method AnimationNodeStateMachinePlayback.travel], the animation is restarted. If [code]false[/code], nothing happens on the teleportation to the self state.
If [code]true[/code], 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 [code]false[/code] 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 [enum AnimationNodeStateMachine.StateMachineType].
Seeking to the beginning is treated as playing from the start state. Transition to the end state is treated as exiting the state machine.
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.
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 [member state_machine_type] of [constant STATE_MACHINE_TYPE_ROOT] or [constant STATE_MACHINE_TYPE_NESTED] in the parent or ancestor.