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

Animating triggers - creating a death trap


In this recipe, we will animate a trigger position and use it to create a death trap. You can use Unity's Animation View to create various game play mechanisms with minimum scripting.

Getting ready

Before we start, you should prepare a death trap model. We are using a "press trap" as an example. It contains two identical moving elements. See the following screenshot:

The model is not skinned and has no rig; instead, the moving elements are separate objects. We will animate them with Unity's Animation View. You can also use the example Unity project provided and go to the Chapter 02 Working with the animation view\Recipe 06 Animating triggers - creating a death trap directory. You will find an Example.unity scene there. If you play the game, you can see the trap working. If you open the scene, you will find the Trap game object with the LeftTrap and RightTrap game objects as its children. Those child objects are the only ones animated in this example...