====== Animation Event ======
Triggers when a given animation event (**find** argument) is played.
{{fa>info?color=#3bb0ff&fw&lg}} This event is used for **animation events** as seen [[https://wiki.facepunch.com/gmod/Enums/PLAYERANIMEVENT|here]] (e.g. jump).
This **__doesn't__** mean the model's **"animations"** properly speaking. What we call an "animation" in common parlance usually refers to sequences. Instead, outside of pac3, "animation events" refers to specific **__player actions__**. Be aware of that distinction.
For more context, animation events are not always implemented in the playermodel's internal definition. There's also not always one for each action you can think of, plus a lot seem to be unused (e.g. not all weapons actually send "attack secondary" if you use their alt-fire mode) or broken so you might never get them to work in pac3. Very few seem to work reliably. The rest are mentioned in the list collapsed under the red button below.
{{fa>info?color=#3bb0ff&fw&lg}} If you're looking for an event that finds the animation sequence (e.g. jump_pistol) running on your model, see [[#sequence name]].
===== Operator =====
Any **string** [[#operators|operator]].
===== Arguments =====
^name^type^description^
|**time** | number | For how many seconds should the event be active after triggering. Default is 0.1 |
|**find** | string | Animation event to look for. List below. |
===== Animation Events =====
^name^description^
|**attack primary** | Using primary attack on a weapon. Does NOT work with Physics / Gravity Gun. Other known exception: for HL2 crossbow, use reload instead. |
|**reload**| Reloading a weapon |
|**jump**| Jumping |
|**cancel reload**| Switching weapons |
Events bellow don't seem to work. If you know how to use them move them to the table above.
|**attack secondary** | Using secondary attack on a weapon. Can't get it to work?? |
|**attack grenade** | Grenade throw Can't get it to work?? |
|**reload loop**| ??? |
|**reload end**| ??? |
|**swim**| Swimming Can't get it to work?? |
|**die**| Dying Can't get it to work?? |
|**flinch chest**| ??? |
|**flinch head**| ??? |
|**flinch leftarm**| ??? |
|**flinch rightarm**| ??? |
|**flinch leftleg**| ??? |
|**flinch rightleg**| ??? |
|**double jump**| ??? |
|**cancel**| ??? |
|**spawn**| Spawning Can't get it to work?? |
|**snap yaw**| ??? |
|**custom**| ??? |
|**custom gesture**| ??? |
|**custom sequence**| ??? |
|**custom sequence gesture**| ??? |
===== Example =====
Set the event to **animation_event**, operator to **find**, find to **jump**, time to **2**. The event will trigger and stay active for 2 seconds whenever you jump.
**{{fa>download?color=#7ab353&fw&lg}} Download:** {{asset:example:event_animation_event.txt}}