It is often necessary to do things at a certain time during an animation, for example:
- Footstep Events: play a footstep sound each time a foot touches the ground during a walk animation.
- Golf Events: 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.||Animancer Lite allows you to try out Animancer Events in the Unity Editor, but they won't be available in Runtime Builds unless you purchase Animancer Pro.|
|How to use:
||How to use:
|Animation Events are defined as part of an
||Animancer Events are defined separately from the
|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 aren't 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 don't 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 any that are found can generally be fixed fairly quickly. Having the source code of Animancer Pro also means you can potentially fix and change things yourself if you need to.|