This tutorial is more about explaining what goes on in the AnimationExample scene and how you can use the components in it for your game.

We will go through how to use the following components.

  1. SetAnimatorPropertyTrigger: When an action begins, we can set the Animator's property to trigger, this is equal to Animator.SetTrigger("propertyName");
  2. AudioClipActionHandler: When an action begin, running or finishes, we can fire an audio clip

Now let's begin, open AnimationExample scene, you should see this in the Game View

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/931c1b93-e95e-47d2-ac0d-6ff7855b1a43/Untitled.png

Next, locate the Attack action

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9bfcb5f7-6877-44e0-8f3e-cadad4ed6e9c/Untitled.png

The Property Name is the Property that will be triggered in the Animator when this action begins.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/42eae2e4-af30-4786-8ff2-a76048e8d5c9/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dd3588ab-4547-4680-a910-47b76441a3b5/Untitled.png

Let's change the Property name to Jump. This will fire the Jump animation. In our case, our character isn't using RootMotion so he will be jumping on the spot.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1d383b93-d056-4d3b-9aea-f2b3d4d79523/Untitled.png

Remove the AudioClip from Post Perform Clip and add it to Pre Perform Clip. This will play a sound just before the jump begins.