Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
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")
var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
stateMachine.Travel("some_state");
Tutorials¶
Properties¶
|
||
|
||
|
Methods¶
void |
add_node ( StringName name, AnimationNode node, Vector2 position=Vector2(0, 0) ) |
void |
add_transition ( StringName from, StringName to, AnimationNodeStateMachineTransition transition ) |
get_graph_offset ( ) const |
|
get_node ( StringName name ) const |
|
get_node_name ( AnimationNode node ) const |
|
get_node_position ( StringName name ) const |
|
get_transition ( int idx ) const |
|
get_transition_count ( ) const |
|
get_transition_from ( int idx ) const |
|
get_transition_to ( int idx ) const |
|
has_node ( StringName name ) const |
|
has_transition ( StringName from, StringName to ) const |
|
void |
remove_node ( StringName name ) |
void |