O'Reilly logo

Unity 4.x Cookbook by Matt Smith, Chico Queiroz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Overriding Root Motion via script

Applying Root Motion to your character is a very practical and accurate way of animating it. However, every now and then you might need to manually control one or more aspects of the character's movement. Perhaps you only have an in-place animation to work with, or maybe you want the character's movement to be affected by other variables. In such cases, you will need to override Root Motion via script.

In this recipe, we will control the character's movement via script, making it rotate and jump.

Getting ready

For this recipe, we have prepared a project named MixamoProject, containing several assets such as levels, animated characters, and props. You can find it inside the 0423_05_codes folder.

How to do it...

To apply ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required