In order to better synchronize character animations and actions, we use animation events in the kit.
Add the PlayStepSound event with the float parameter Volume to movement animations for characters and enemies so that footstep sounds plays during the game.
To synchronize an animation and grenade throw add the LaunchGrenade event to a throw grenade animation.
To synchronize the sound of a melee attack (for characters and enemies) with animation add the PlayAttackSound event.
To synchronize an animation and shells spawn add the SpawnShell event to a shot animation and disable the Spawn Shells Immediately toggle in the WeaponController script.
To synchronize show and hiding of a weapon magazine with reload animations set it in the WeaponController script...
...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 |
​
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 | Set the right hand as a parent for the weapons and place it in a default position. ​ If after animation weapon has the wrong position or rotation, this event we'll help you to fix that. |