The Events page compares the differences between Unity's inbuilt Animation Events and Animancer Events and this page explains several other important details about the way Animancer Events work.
Looping
Events behave differently depending on whether the animation is looping or not:
Type | Trigger Conditions |
---|---|
Non-Looping | Once on the frame when the animation passes the specified time. |
Looping | Every loop on the frame when the animation passes the specified time.
|
End Events | On every frame when the animation has passed the specified time, regardless of whether the animation is looping or not. |
Other Details
This system has several other details worth mentioning:
- Changing the
AnimancerState.Time
(orNormalizedTime
) prevents that state from triggering any more events during that frame. If you want events between the old and new time to be triggered, you can useAnimancerState.MoveTime
instead. - The
AnimancerState.Events
sequence can not be modified by its own events (i.e. you can't use an event to add another event to the state that triggered it). - Animancer Events can be placed on Mixers or on their children depending on whether you want them to be triggered according to the weighted average
NormalizedTime
of the children or theNormalizedTime
of a specific child. The Events section on that page gives more details. - They also technically work with Controller States, though they are tied to the overall
ControllerState
and do not check what the Animator Controller is doing internally so attempting to use them might not give the intended result. - If you want to run custom code as part of the animation update, you can implement
IUpdatable
in your own scripts.