Book Image

Unity 5.x Animation Cookbook

By : Maciej Szczesnik
Book Image

Unity 5.x Animation Cookbook

By: Maciej Szczesnik

Overview of this book

This recipe-based practical guide will show you how to unleash the power of animation in Unity 5.x and make your games visually impeccable. Our primary focus is on showing you tools and techniques to animate not only humanoid biped characters, but also other elements. This includes non-humanoid character animation, game world creation, UI element animation, and other key features such as opening doors, changing lights, transitioning to different scenes, using physics, setting up ragdolls, creating destructible objects and more. While discussing these topics, the book will focus on mecanim, the Unity 3D animation tool, and how you can use it to perform all these tasks efficiently and quickly. It contains a downloadable Unity project with interactive examples for all the recipes. By the end of this book, you will be confident and self-sufficient in animating your Unity 3D games efficiently.
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Adding animation to off-mesh links


In Unity characters with Nav Mesh Agent component can navigate in the scene using pre-baked NavMesh. There are cases when NavMesh can have some discontinuities, for instance when we have a chasm or a cliff in the scene. In such cases, we can define the so-called Off Mesh Links to tell the character that he can jump over the chasm or drop from a cliff and continue navigation. In this recipe, we will use a character with a Nav Mesh Agent component and animate the off-mesh transitions using root motion.

Getting ready

We are going to use the same character as in the Using root motion to drive NavMesh Agents' movement with animations recipe with the Idle, WalkLeft, WalkForward, and WalkRight animations. Additionally, you should prepare a single JumpOffMesh animation with forward root motion transition (starting and ending with an Idle pose). We are going to use the NavMeshAgentWithRigidBody.cs and ClickToMove.cs scripts from the previously mentioned recipe to...