Book Image

Unity Animation Essentials

By : Alan Thorn
Book Image

Unity Animation Essentials

By: Alan Thorn

Overview of this book

Table of Contents (14 chapters)
Unity Animation Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Root motion


Based on the previous example, we've created a scene where an imported character undergoes a walking animation from the Unity characters package. On pressing Play, you'll notice the character not only plays a walk animation but actually walks forwards in the scene, as opposed to in-place walking. In other words, a walk animation plays and the character moves in terms of his scene position. This happens because of root motion. Root motion refers to any animation or change applied to the position and rotation of the topmost (root) object in the mesh hierarchy. The imported character mesh contains many child objects, for its bones and pieces. However, animation applied to the top-level object is regarded as root motion. By default, root motion is enabled for the character, which means that it will move when the animation plays. You can, however, disable root motion, causing the character to walk in-place, that is, walk without moving anywhere. To achieve this, select the character...