Summary
The
Animancer.AnimancerState.Time
of this state as a portion of the animation's Animancer.AnimancerState.Length
, meaning the
value goes from 0 to 1 as it plays from start to end, regardless of how long that actually takes.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- AnimancerState
Syntax
public float NormalizedTime { get; set; }
Examples
void PlayAnimation(AnimancerComponent animancer, AnimationClip clip)
{
var state = animancer.Play(clip);
// Skip 0.5 seconds into the animation:
state.Time = 0.5f;
// Skip 50% of the way through the animation (0.5 in a range of 0 to 1):
state.NormalizedTime = 0.5f;
// Skip to the end of the animation and play backwards.
state.NormalizedTime = 1;
state.Speed = -1;
}
Remarks
This value will continue increasing after the animation passes the end of its
Animancer.AnimancerState.Length
while
the animated object either freezes in place or starts again from the beginning according to whether it is
looping or not.
The fractional part of the value (NormalizedTime % 1
) is the percentage (0-1) of progress in the
current loop while the integer part ((int)NormalizedTime
) is the number of times the animation has
been looped.
Events and root motion between the old and new time will be skipped when setting this value. Use
Animancer.AnimancerState.MoveTime(System.Single,System.Boolean)
instead if you don't want that behaviour.
Animancer Lite does not allow this value to be changed in runtime builds (except resetting it to 0).
Value
Type | Description |
---|---|
float |