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

Blending light colors with the Animation View and the Animator Controller


This recipe shows how to use Animation Controllers with the clips created in Animation View.

Getting ready

We will animate the light color in this example. You need to have a scene with at least one light and a mesh to see the effect. You can also download the provided example Unity project and go to the Chapter 02 Working with the animation view\Recipe 02 Using the animation view and the animator controller to blend light colors directory. You will find a scene called Example.unity there, with a direction light that has already been animated. In this example, we also animate the background color of the camera (the camera is a child object of the directional light).

How to do it...

To blend animations (colors in this example) of a game object, you need to follow these steps:

  1. Open the scene and select the light game object in the Hierarchy.
  2. With the light selected, go to Window | Animation to open the Animation View and create...