AnimationNodeStateMachinePlayback
Controls an AnimationTree state-machine instance.
Retrieve it from your tree at the corresponding parameters/.../playback path. Start() requests a direct start; Travel() requests a transition route and can jump directly if none exists. Tree processing applies the change.
Do not create a separate playback instead of retrieving the live tree parameter. A graph resource can be shared while this object holds instance state.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AnimationNodeStateMachinePlaybackConstructor
public AnimationNodeStateMachinePlayback();Methods14
GetCurrentLengthfloat
public float GetCurrentLength();Returns the current state length.
Note: It is possible that any AnimationRootNode can be nodes as well as animations. This means that there can be multiple animations within a single state. Which animation length has priority depends on the nodes connected inside it. Also, if a transition does not reset, the remaining length at that point will be returned.
floatGetCurrentNodeStringName
public StringName GetCurrentNode();The current state name after the latest processing step. It is a graph element, not a gameplay entity. Start()/Travel() need not change it synchronously; wait for an AnimationTree step.
StringNameGetCurrentPlayPositionfloat
public float GetCurrentPlayPosition();Returns the playback position within the current animation state.
floatGetFadingFromLengthfloat
public float GetFadingFromLength();Returns the playback state length of the node from AnimationNodeStateMachinePlayback.GetFadingFromNode. Returns 0 if no animation fade is occurring.
floatGetFadingFromNodeStringName
public StringName GetFadingFromNode();Returns the starting state of currently fading animation.
StringNameGetFadingFromPlayPositionfloat
public float GetFadingFromPlayPosition();Returns the playback position of the node from AnimationNodeStateMachinePlayback.GetFadingFromNode. Returns 0 if no animation fade is occurring.
floatGetFadingLengthfloat
public float GetFadingLength();Returns the length of the current fade animation. Returns 0 if no animation fade is occurring.
floatGetFadingPositionfloat
public float GetFadingPosition();Returns the playback position of the current fade animation. Returns 0 if no animation fade is occurring.
floatGetTravelPathReckfell.Collections.Array<StringName>
public Reckfell.Collections.Array<StringName> GetTravelPath();Returns the current travel path as computed internally by the A* algorithm.
Reckfell.Collections.Array<StringName>IsPlayingbool
public bool IsPlaying();Returns true if an animation is playing.
boolNextvoid
public void Next();If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.
Startvoid
public void Start(StringName node, bool reset = true);Requests a direct state start without route finding. reset controls time reset. The tree applies it during processing, so an immediate GetCurrentNode() can still report the previous state.
| Name | Type | Default |
|---|---|---|
node | StringName | — |
reset | bool | true |
Stopvoid
public void Stop();Stops the currently playing animation.
Travelvoid
public void Travel(StringName toNode, bool resetOnTeleport = true);Requests a route to a state through allowed graph transitions; processing applies the request. If no route exists, it can jump directly to the target, with reset controlled by resetOnTeleport. Do not use Travel() to authorize a gameplay action.
| Name | Type | Default |
|---|---|---|
toNode | StringName | — |
resetOnTeleport | bool | true |
Signals and events2
StateFinishedEvent
public event AnimationNodeStateMachinePlayback.StateFinishedEventHandler StateFinished;Emitted when the state finishes playback. If state is a state machine set to grouped mode, its signals are passed through with its name prefixed.
If there is a crossfade, this will be fired when the influence of the AnimationNodeStateMachinePlayback.GetFadingFromNode animation is no longer present.
| Name | Type | Default |
|---|---|---|
state | StringName | — |
StateStartedEvent
public event AnimationNodeStateMachinePlayback.StateStartedEventHandler StateStarted;Emitted when the state starts playback. If state is a state machine set to grouped mode, its signals are passed through with its name prefixed.
| Name | Type | Default |
|---|---|---|
state | StringName | — |