> For the complete documentation index, see [llms.txt](https://harpiagames.gitbook.io/quick-animation-events/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harpiagames.gitbook.io/quick-animation-events/understanding-animation-events.md).

# Understanding Animation Events

It's always good to know how animation events work inside unity

Check the official animation event Documentation: <https://docs.unity3d.com/Manual/script-AnimationWindowEvent.html>

Use an **Animation Event** to trigger a function at a specific moment in an animation. This function can be in any script attached to the **GameObject**, but it must accept only a single parameter of one of the following types: `float`, `int`, `string`, an **object reference**, or an **AnimationEvent** object. **Make sure the GameObject has both an Animator component and the script containing the event functions.**

If you need to pass multiple parameters, you can use an **AnimationEvent** object. This object allows you to include a `float`, an `int`, a `string`, and an **object reference** as member values. Additionally, it provides information about the Animation Event that triggered the function.

<figure><img src="https://712870624-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcWsFJgdDL5XJoVljTJ2N%2Fuploads%2FrqlKFVJncCFxu4in1FiY%2Fimage.png?alt=media&amp;token=a351434d-44f5-48fd-a41b-9d2977c1830a" alt=""><figcaption><p>Image from unity Docs showing the animation events</p></figcaption></figure>
