public sealed class PlayAnimationTaskPlays an animation state on a layer, and optionally waits for it.
Remarks
doc 37 § Part 3's PlayAnimation. It asks the state machine to play a state; what actually plays is that state's motion, which may be a clip, a blend tree or a MoveSetMotion picking from a move set. That is the move-set half of the row, and it is a property of how the state was authored rather than a second node here — a task that reached past the state machine into a move set would be a second way to drive an animator, and the two would disagree about what is playing.
⚠ "Played through" is a loop, not a time. The task succeeds when the state's normalised time reaches one or wraps, and also when something else has taken the machine somewhere — a transition fired by a parameter, or another branch's task. Waiting on a fixed duration instead would desynchronise the moment anybody changed the clip, and would never end for a state that loops.
Fields and properties (1)
public static int StateSizeHow many bytes it needs.
Methods (4)
public PlayAnimationTask(string layer, string stateName, float crossfade = 0.15, bool wait = true)Plays an animation state on a layer, and optionally waits for it.
public void Start(in AgentContext context, Span<byte> state)Begins. Called once before the first Tick, on a zeroed span.
public ActionStatus Tick(in AgentContext context, Span<byte> state, float delta)Advances it.
public void Abort(in AgentContext context, Span<byte> state)Stops it early. The span is zeroed afterwards; this is for what is outside it.
Used by (2)
- PlayAnimationTestsVixen.Ai.Nodes.Tests
- WorldNodesVixen.Ai.Nodes