Unity's inbuilt Animation Event system works the same when using Animancer as without it.
- Add an event to your animation. The Unity Manual explains how to set up events depending on how the animation is imported:
Asset Type | Configure Events Using |
---|---|
Model (e.g. FBX) | Animation Tab in the model's Import Settings |
.anim |
Animation Window |
- Write a script with a method that has the same name as the
Function Name
you gave the event. - Attach that script to the same object as the
Animator
component that will play the animation. - When the animation passes the event's time, Unity will call your method.
It might be convenient to have your script Interit from AnimancerComponent
for organizational purposes (instead of having two separate components), but most events don't actually have any direct interaction with Animancer.
Note that any event with a string
or AnimationEvent
parameter will allocate some Garbage every time it is triggered, which can potentially cause performance issues.