> For the complete documentation index, see [llms.txt](https://docs.gercstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gercstudio.com/other-components/events.md).

# Animation Events

To better synchronize character animations and game actions, use various animation events.

### Step Sounds

Add the **PlayStepSound** event with the **float** parameter **Volume** to movement animations for characters and enemies so that footstep sounds plays during the game.

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rEuBm8-FnM-XhEAwr%2FStepSound%20Event.png?alt=media\&token=dda9f0d5-37da-4ae5-b977-a4ae67010e55)

### Grenades

To synchronize an animation and grenade throw add the **LaunchGrenade** event to a throw grenade animation.

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rEWmOXv9mXXtkkF8V%2FLaunch%20Grenade%20Event.png?alt=media\&token=e5a4c31b-7ed9-4b90-bfc7-8b0ce65ba5f2)

### Melee Attacks

To synchronize the sound of a melee attack (for characters and enemies) with animation add the **PlayAttackSound** event.

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rT2Mn7CPeuWY1-p92%2FMelee%20Events.png?alt=media\&token=b3961367-3b42-4503-a326-77fca0ab45ef)

### Shells

To synchronize an animation and shell spawn add the **SpawnShell** event to the shooting animation and disable the **Spawn Shells Immediately** toggle in the <mark style="color:green;">**Weapon Controller**</mark> script.

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rFHOsLMmj4Vmk6wVK%2FShells%20Event.png?alt=media\&token=5748bb8f-9195-46ec-88bc-a83fb353c657)

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rFOsFHRO0Dr_hPdJQ%2FSpawn%20Shell%20Imd%20.png?alt=media\&token=e4afe331-4015-41a0-a808-51389972a9d3)

## Weapons&#x20;

### Magazines&#x20;

To synchronize the appearance and hide the weapon magazine with the reloading animation, indicate the magazine in the <mark style="color:green;">**Weapon Controller**</mark> script...

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rS6jG9z8H_n7IsW3A%2FMag.png?alt=media\&token=10ec251d-95ce-4547-a6e2-18c814d7bb52)

...and use the following events:

| Event                        | String Parameter  | Meaning                                           |
| ---------------------------- | ----------------- | ------------------------------------------------- |
| **ChangeMagazineVisibility** | **show**          | Show the default magazine                         |
|                              | **hide**          | Hide the default magazine                         |
|                              | **hideAndCreate** | Hide the default magazine and create a copy of it |
| **DropMagazine**             | **-**             | Drop a magazine from the weapon                   |

### Change Hands

If you use animation in which a character takes weapons in different hands, the following events will come in handy:

| Event            | String Parameter  | Meaning                                                                                                                                                                                                      |
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **ChangeParent** | **left**          | Set the left hand as a parent for the weapons                                                                                                                                                                |
|                  | **right**         | Set the right hand as a parent for the weapons                                                                                                                                                               |
|                  | **rightAndPlace** | <p>Set the right hand as a parent for the weapons and place it in a default position. </p><p></p><p>If after animation weapon has the wrong position or rotation, this event we'll help you to fix that.</p> |

![](https://3854890582-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf4aWZpqUiSipiEh-D6%2F-M0rDwDeOhtVR6hfaJJu%2F-M0rOYQ5EbtfAp3Duc5V%2Fevents.gif?alt=media\&token=389fc36e-2186-4f90-9ab5-5a52a2ded1ac)
