You will often have the need to do things at a certain time during an animation, for example:
- Play a footstep sound each time a foot touches the ground during a walk cycle.
- Hit a golf ball when your swing passes a certain point.
You could script these things using coroutines or other timers, but using Unity's inbuilt Animation Events or Animancer's custom event system 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 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.||
|There are several Known Bugs in the Animation Events system which can only be fixed by waiting for Unity to address them and release a new version.||There are currently no known bugs in the Animancer Events system and having the source code of Animancer Pro allows any that are found to be quickly fixed without even needing to wait for the Asset Store to approve an update.|