API Reference · Animation

AnimationState

Namespace: Ava3D

public sealed class AnimationState

One clip as something that can be playing: its own time, speed, looping and blend weight.

Properties

MemberDescription
AnimationClip Clip { get; }

The clip behind it.

bool IsPlaying { get; }

Whether it is contributing to the pose at all.

bool Loop { get; set; }

Whether it restarts at the end instead of finishing.

The default follows . Once an animator has a default state, that one loops and every other one plays once — which is the shape a character file actually has: a cycle to stand in and a set of gestures that return to it. With no default set, the fallback is AnimationClip.LoopsCleanly, so a lone walk cycle still cycles.

This is a default and not a rule. Assigning it settles the question for this state permanently, and nothing about Animator.Default overrides it afterwards — which is how a second looping state, or a default that plays through once and stops, is expressed.

string Name { get; }

The name it is addressed by — the clip's own name, or an index when the file gave none.

float Speed { get; set; }

Playback rate. 1 is as authored; negative runs it backwards.

float Time { get; set; }

Where the playhead is, in seconds. Settable, which is what a recorder pinning a frame or a caller scrubbing a slider needs — see Animator.Advance for why the library owns no clock.

Writing it is a seek, and Animator.RootMotion treats it as one: the jump from where the playhead was to where it was put is not distance the character walked, and reporting it would teleport anything driven by that the moment a scrubber moved.

float Weight { get; }

How much of the final pose is this state, 0 to 1. Driven by the fade; read-only.

Events

MemberDescription
event EventHandler Finished

Raised when a non-looping state reaches the end of its clip.

See also