State machine for control of animations.
Contains multiple nodes representing animation states, connected in a graph. Node 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 node to the graph. The [param position] is used for display in the editor.
Adds a transition between the given 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 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 node.
Returns [code]true[/code] if there is a transition between the given nodes.
Deletes the given node from the graph.
Deletes the transition between the two specified nodes.
Deletes the given transition by index.
Renames the given node.
Sets the draw offset of the graph. Used for display in the editor.
Sets the 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.