Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AnimationNodeStateMachine

Inherits: AnimationRootNode < AnimationNode < Resource < RefCounted < Object

A state machine with multiple AnimationRootNodes, used by AnimationTree.

Description

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:

var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")

Tutorials

Properties

bool

allow_transition_to_self

false

bool

reset_ends

false

StateMachineType

state_machine_type

0

Methods

void

add_node ( StringName name, AnimationNode node, Vector2 position=Vector2(0, 0) )

void

add_transition ( StringName from, StringName to, AnimationNodeStateMachineTransition transition )

Vector2

get_graph_offset ( ) const

AnimationNode

get_node ( StringName name ) const

StringName

get_node_name ( AnimationNode node ) const

Vector2

get_node_position ( StringName name ) const

AnimationNodeStateMachineTransition

get_transition ( int idx ) const

int

get_transition_count ( ) const

StringName

get_transition_from ( int idx ) const

StringName

get_transition_to ( int idx ) const

bool

has_node ( StringName name ) const

bool

has_transition ( StringName from, StringName to ) const

void

remove_node ( StringName name )

void

remove_transition ( StringName from, StringName to )

void

remove_transition_by_index ( int idx )

void

rename_node ( StringName name,