AnimationNodeStateMachinePlayback

Inherits: Resource < RefCounted < Object

Playback control for AnimationNodeStateMachine.

Description

Allows control of AnimationTree state machines created with AnimationNodeStateMachine. Retrieve with $AnimationTree.get("parameters/playback").

Example:

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

Tutorials

Properties

bool

resource_local_to_scene

true (overrides Resource)

Methods

float

get_current_length ( ) const

StringName

get_current_node ( ) const

float

get_current_play_position ( ) const

StringName

get_fading_from_node ( ) const

PackedStringArray

get_travel_path ( ) const

bool

is_playing ( ) const

void

next ( )

void

start ( StringName node, bool reset=true )

void

stop ( )

void

travel ( StringName to_node, bool reset_on_teleport=true )


Method Descriptions

float get_current_length ( ) const

There is currently no description for this method. Please help us by contributing one!


StringName get_current_node ( ) const

Returns the currently playing animation state.


float get_current_play_position ( ) const

Returns the playback position within the current animation state.


StringName get_fading_from_node ( ) const

Returns the starting state of currently fading animation.


PackedStringArray get_travel_path ( ) const

Returns the current travel path as computed internally by the A* algorithm.


bool is_playing ( ) const

Returns true if an animation is playing.


void next ( )

If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.


void start ( StringName node, bool reset=true )

Starts playing the given animation.

If reset is true, the animation is played from the beginning.


void stop ( )

Stops the currently playing animation.


void travel ( StringName to_node, bool reset_on_teleport=true )

Transitions from the current state to another one, following the shortest path.

If the path does not connect from the current state, the animation will play after the state teleports.

If reset_on_teleport is true, the animation is played from the beginning when the travel cause a teleportation.