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

Synchronizing an animation with objects in the scene


In this recipe, we will synchronize a character's animation with an object placed in the scene. This is again a common mechanism used in games.

Getting ready

To follow this recipe, you need two animated game objects: a character and an interactive object. In our example, we use a wheel lever that the character can rotate. We use only two animations, WheelStart and WheelLoop, for both the Character and the Wheel objects. The animations have the same number of frames and are synchronized in a 3D package already. You can also open the provided example Unity project and go to the Chapter 05 Character actions and expressions\Recipe 06 Synchronizing an animation with objects in the scene directory. You will find an Example.scene there. Play the game and press the space bar to see the Character and the Wheel play a synchronized animation. You will find all the necessary animations in the Rigs directory.

Character and Wheel objects playing synchronized...