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 animation of multiple objects


In a cutscene, we have to synchronize animation of multiple objects in time. This recipe shows how to do it.

Getting ready

To follow this recipe, you will need an animated character and an animated object. You can download the provided example Unity project and go to the Chapter 08 Animating Cutscenes\Recipe 03 Synchronizing animation of multiple objects directory. You can find the Example.unity scene there. If you play the game, you will see a character kicking a soccer ball. Both objects are animated and synchronized. You can find the needed animations in the Animations directory:

Synchronized animation of the ball and a the character kicking it

How to do it...

To synchronize animation of multiple objects, follow these steps:

  1. Open both objects in your 3D package (we are using Blender in this example).
  2. Synchronize both objects' animations in the 3D package. In our example, the animation has about 160 frames. Both objects have the same length of animation...