Summary
The number of seconds that have passed since the start of this animation.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- AnimancerState
Syntax
public float Time { 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 underlying double can be accessed via Animancer.AnimancerState.TimeD.
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 |