AnimancerState.

Duration Property

Summary

The number of seconds the animation will take to play fully at its current Animancer.AnimancerNode.Speed.

For the time remaining from now until it reaches the end, use Animancer.AnimancerState.RemainingDuration instead.

Setting this value modifies the Animancer.AnimancerNode.Speed, not the Animancer.AnimancerState.Length.

Animancer Lite does not allow this value to be changed in runtime builds.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
AnimancerState

Syntax

public float Duration { get; set; }

Examples

 void PlayAnimation(AnimancerComponent animancer, AnimationClip clip)
 {
     var state = animancer.Play(clip);

     state.Duration = 1;// Play fully in 1 second.
     state.Duration = 2;// Play fully in 2 seconds.
     state.Duration = 0.5f;// Play fully in half a second.
     state.Duration = -1;// Play backwards fully in 1 second.
     state.NormalizedTime = 1; state.Duration = -1;// Play backwards from the end in 1 second.
 }

Value

Type Description
float