You will often have the need to do things at a certain time during an animation, for example:
- Hit a golf ball when your swing passes a certain point.
- Play a footstep sound each time a foot touches the ground during a walk cycle.
You could script these things using coroutines or other timers, but using Animancer Events or Unity's inbuilt Animation Events allows you to preview the animation while configuring events so you can easily configure the exact timing you want. The following table summarises the differences between the two event systems.
|Animation Events||Animancer Events|
|Built into Unity. They work the same with Animancer as without it.||End Events are included in Animancer Lite, but the ability to set a custom end time and use other Animancer Events is only available in the Unity Editor unless you purchase Animancer Pro.|
|Animation Events are defined as part of an
||Animancer Events are defined as part of an
|Each Animation Event calls one method which must be located in a component on the same
|The method can be
|The method can have at most one parameter of any of the following types:
|Animation Events are not very efficient because they use a mechanism similar to
Animancer Events are much more efficient because they use C# Delegates.Animancer Events configured in the Inspector using
|Animation Events can be added using code, but they are still subject to all the above limitations. If you are using an Animator Controller, you do not even have access to the
||Animancer Events can be added using Delegates. For example:
|Methods are referenced using Magic Strings. Newer Unity versions use a dropdown menu to select the method instead of a text field to enter the name manually, but once selected the name is still stored as a string so if the method is renamed the Animation Event will not be automatically updated to reference the new name.||