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; }
Remarks
This value continues increasing after the animation passes the end of its
Animancer.AnimancerState.Length
, regardless of whether it Animancer.AnimancerState.IsLooping
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.
Setting this value will skip Events and Root Motion between the old and new time.
Use Animancer.AnimancerState.MoveTime(System.Single,System.Boolean)
instead if you don't want that behaviour.
Animancer Lite doesn't allow this value to be changed in runtime builds (except resetting it to 0).
Example: void TimeExample(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;
}
Value
Type | Description |
---|---|
float |