reckfellENGINE

AnimationNodeStateMachine

A state machine with multiple AnimationRootNodes, used by AnimationTree.

On this page
class AnimationNodeStateMachineReckfellSharpInherits AnimationRootNode

A state machine with multiple AnimationRootNodes, used by AnimationTree.

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.

C#
var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback") as AnimationNodeStateMachinePlayback;
stateMachine.Travel("some_state");

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

AnimationNodeStateMachineConstructor
# AnimationNodeStateMachine
C#
public AnimationNodeStateMachine();

Properties3

AllowTransitionToSelfProperty
# AllowTransitionToSelf
C#
public bool AllowTransitionToSelf { get; set; }

If true, allows teleport to the self state with AnimationNodeStateMachinePlayback.Travel. When the reset option is enabled in AnimationNodeStateMachinePlayback.Travel, the animation is restarted. If false, nothing happens on the teleportation to the self state.

ResetEndsProperty
# ResetEnds
C#
public bool ResetEnds { get; set; }

If true, treat the cross-fade to the start and end nodes as a blend with the RESET animation. In most cases, when additional cross-fades are performed in the parent AnimationNode of the state machine, setting this property to false and matching the cross-fade time of the parent AnimationNode and the state machine's start node and end node gives good results.

StateMachineTypeProperty
# StateMachineType
C#
public AnimationNodeStateMachine.StateMachineTypeEnum StateMachineType { get; set; }

This property can define the process of transitions for different use cases. See also AnimationNodeStateMachine.StateMachineTypeEnum.

Methods26

AddNodevoid
# AddNode
C#
public void AddNode(StringName name, AnimationNode node, Vector2? position = default);

Adds a new animation node to the graph. The position is used for display in the editor.

Parameters
NameTypeDefault
nameStringName—
nodeAnimationNode—
positionVector2?default
position

If the parameter is null, then the default value is new Vector2(0.0f, 0.0f).

AddTransitionvoid
# AddTransition
C#
public void AddTransition(StringName from, StringName to, AnimationNodeStateMachineTransition transition);

Adds a transition between the given animation nodes.

Parameters
NameTypeDefault
fromStringName—
toStringName—
transitionAnimationNodeStateMachineTransition—
AreEndsResetbool
# AreEndsReset
C#
public bool AreEndsReset();
Returns bool
GetGraphOffsetVector2
# GetGraphOffset
C#
public Vector2 GetGraphOffset();

Returns the draw offset of the graph. Used for display in the editor.

Returns Vector2
GetNodeAnimationNode
# GetNode
C#
public AnimationNode GetNode(StringName name);

Returns the animation node with the given name.

Parameters
NameTypeDefault
nameStringName—
Returns AnimationNode
GetNodeListReckfell.Collections.Array<StringName>
# GetNodeList
C#
public Reckfell.Collections.Array<StringName> GetNodeList();

Returns a list containing the names of all animation nodes in this state machine.

Returns Reckfell.Collections.Array<StringName>
GetNodeNameStringName
# GetNodeName
C#
public StringName GetNodeName(AnimationNode node);

Returns the given animation node's name.

Parameters
NameTypeDefault
nodeAnimationNode—
Returns StringName
GetNodePositionVector2
# GetNodePosition
C#
public Vector2 GetNodePosition(StringName name);

Returns the given animation node's coordinates. Used for display in the editor.

Parameters
NameTypeDefault
nameStringName—
Returns Vector2
GetStateMachineTypeAnimationNodeStateMachine.StateMachineTypeEnum
# GetStateMachineType
C#
public AnimationNodeStateMachine.StateMachineTypeEnum GetStateMachineType();
Returns AnimationNodeStateMachine.StateMachineTypeEnum
GetTransitionAnimationNodeStateMachineTransition
# GetTransition
C#
public AnimationNodeStateMachineTransition GetTransition(int idx);

Returns the given transition.

Parameters
NameTypeDefault
idxint—
Returns AnimationNodeStateMachineTransition
GetTransitionCountint
# GetTransitionCount
C#
public int GetTransitionCount();

Returns the number of connections in the graph.

Returns int
GetTransitionFromStringName
# GetTransitionFrom
C#
public StringName GetTransitionFrom(int idx);

Returns the given transition's start node.

Parameters
NameTypeDefault
idxint—
Returns StringName
GetTransitionToStringName
# GetTransitionTo
C#
public StringName GetTransitionTo(int idx);

Returns the given transition's end node.

Parameters
NameTypeDefault
idxint—
Returns StringName
HasNodebool
# HasNode
C#
public bool HasNode(StringName name);

Returns true if the graph contains the given animation node.

Parameters
NameTypeDefault
nameStringName—
Returns bool
HasTransitionbool
# HasTransition
C#
public bool HasTransition(StringName from, StringName to);

Returns true if there is a transition between the given animation nodes.

Parameters
NameTypeDefault
fromStringName—
toStringName—
Returns bool
IsAllowTransitionToSelfbool
# IsAllowTransitionToSelf
C#
public bool IsAllowTransitionToSelf();
Returns bool
RemoveNodevoid
# RemoveNode
C#
public void RemoveNode(StringName name);

Deletes the given animation node from the graph.

Parameters
NameTypeDefault
nameStringName—
RemoveTransitionvoid
# RemoveTransition
C#
public void RemoveTransition(StringName from, StringName to);

Deletes the transition between the two specified animation nodes.

Parameters
NameTypeDefault
fromStringName—
toStringName—
RemoveTransitionByIndexvoid
# RemoveTransitionByIndex
C#
public void RemoveTransitionByIndex(int idx);

Deletes the given transition by index.

Parameters
NameTypeDefault
idxint—
RenameNodevoid
# RenameNode
C#
public void RenameNode(StringName name, StringName newName);

Renames the given animation node.

Parameters
NameTypeDefault
nameStringName—
newNameStringName—
ReplaceNodevoid
# ReplaceNode
C#
public void ReplaceNode(StringName name, AnimationNode node);

Replaces the given animation node with a new animation node.

Parameters
NameTypeDefault
nameStringName—
nodeAnimationNode—
SetAllowTransitionToSelfvoid
# SetAllowTransitionToSelf
C#
public void SetAllowTransitionToSelf(bool enable);
Parameters
NameTypeDefault
enablebool—
SetGraphOffsetvoid
# SetGraphOffset
C#
public void SetGraphOffset(Vector2 offset);

Sets the draw offset of the graph. Used for display in the editor.

Parameters
NameTypeDefault
offsetVector2—
SetNodePositionvoid
# SetNodePosition
C#
public void SetNodePosition(StringName name, Vector2 position);

Sets the animation node's coordinates. Used for display in the editor.

Parameters
NameTypeDefault
nameStringName—
positionVector2—
SetResetEndsvoid
# SetResetEnds
C#
public void SetResetEnds(bool enable);
Parameters
NameTypeDefault
enablebool—
SetStateMachineTypevoid
# SetStateMachineType
C#
public void SetStateMachineType(AnimationNodeStateMachine.StateMachineTypeEnum stateMachineType);
Parameters
NameTypeDefault
stateMachineTypeAnimationNodeStateMachine.StateMachineTypeEnum—

AnimationNodeStateMachine.StateMachineTypeEnum

ValueDescription
Grouped = 2

This is a grouped state machine that can be controlled from a parent state machine. It does not work independently. There must be a state machine with AnimationNodeStateMachine.StateMachineType of AnimationNodeStateMachine.StateMachineTypeEnum.Root or AnimationNodeStateMachine.StateMachineTypeEnum.Nested in the parent or ancestor.

Nested = 1

Seeking to the beginning is treated as seeking to the beginning of the animation in the current state. Transition to the end state, or the absence of transitions in each state, is treated as exiting the state machine.

Root = 0

Seeking to the beginning is treated as playing from the start state. Transition to the end state is treated as exiting the state machine.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.