Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Using Blend Trees to aim


In this recipe, we will use a more sophisticated method of aiming. This method is based on using several aim animations combined into a Blend Tree.

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 06 Handling combat\Recipe 09 Using blend trees to aim directory. You will find an Example.unity scene there, with a Humanoid character. Play the game to see the effect. You can find...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik