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 root motion for a 180 degrees turn


In the previous recipe, we've added a stop animation for a better transition to the idle state. We can add even more animations to our movement to make it more accurate and responsive. An example of such animation is a 180-degree turn.

Getting ready

Use the same character as in the previous recipe. Add a 180-degree turn animation, starting with the Idle pose and ending with the Idle pose rotated by 180 degrees in the vertical axis. Name the animation 180Turn for clarity. You can open the provided example Unity project and go to the Chapter 04 Character movement\Recipe 05 Using root motion for a 180 degrees turn directory. You will find an Example.unity scene there. Play the game and try to walk in the direction opposite to the one the character is facing (press the down arrow). You can find the Humanoid.fbx asset in the Rigs directory with all the required animations.

How to do it...

To make a 180-degree turn, follow these steps:

  1. Create four transitions...
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