Animation Events
Create and capture animation events to run functions in code when your animation hits a specific location.
Overview
In Airship animation events are passed to Typescript through the AnimationEventListener component. If you add this component to your animator it will pass along events from your animations. Airship Characters have this component by default.
Create Animation Events
To setup an event use Unity's animation event system either in the animation clip itself using the animation window, or on an FBX using the inspector window.
Create a new animation event
Give it the function
TriggerEventSet the triggers key to be whatever you would like to identify it by


Listening To Animation Events
To listen to events in Typescript, get the component reference for the AnimationEventListener, then connect to the OnAnimationEvent Signal on Character.animator:
Optional - Pass Data With Event
If you need additional data passed along with the event, you can include an AnimationEventData scriptable object.
In your project, right click to
Create -> Airship -> Animation Event DataFill in the objects data with whatever you want to receive in TS
On your animation, Set the event function to
TriggerEventObjSet the Object variable to the Animation Event Object you created



Now to receive this event in Typescript
Last updated