AnimationNodeStateMachinePlayback

Inherits: Resource < Reference < Object

Category: Core

Brief Description

Playback control for AnimationNodeStateMachine.

Methods

Stringget_current_node ( ) const
PoolStringArrayget_travel_path ( ) const
boolis_playing ( ) const
voidstart ( String node )
voidstop ( )
voidtravel ( String to_node )

Description

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

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

Method Descriptions

  • String get_current_node ( ) const

Returns the currently playing animation state.



  • bool is_playing ( ) const

Returns true if an animation is playing.


Starts playing the given animation.


  • void stop ( )

Stops the currently playing animation.


  • void travel ( String to_node )

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