AnimancerState.

Duration Property

Summary

The number of seconds the animation will take to play fully at its current Animancer.AnimancerNode.EffectiveSpeed.
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.
 }

Remarks

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

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

Animancer Lite does not allow this value to be changed in runtime builds.

Value

Type Description
float