Getting ready

We are going to use the same assets as in the previous recipe, but instead of using the CharacterLookAt.cs script, we will use additional animations: AimForward, AimForwardUp (aim 45 degrees up), AimForwardDown (45 degrees down), AimLeft (45 degrees left), AimLeftUp (45 degrees left and 45 degrees up), Aim LeftDown (45 degrees left and 45 degrees down), AimRight (45 degrees right), AimRightDown (45 degrees right and 45 degrees down), AimRightUp (45 degrees right and 45 degrees up). See the following screenshot for reference:

Nine directional aim animations

You can also use the provided example Unity project and go to the Chapter ...

Get Unity 5.x Animation Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.