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

Using the Animation View to create a flickering light


This first recipe shows how to make a basic animation inside Unity. We will animate a light-intensity value to create an interesting flickering light effect, which is often found in horror or sci-fi games.

Getting ready

Before we start, you need to have a scene with geometry and at least one light. You can also download the example provided; open the project in Unity and go to the folder Chapter 02 Working with the animation view\Recipe 01 Using the animation view to create a flickering light. You will find a scene called Example.unity there, with a point light that has already been animated.

How to do it...

To use the Animation View and create a flickering light, follow these steps:

  1. Open the scene and select a light you want to animate.
  2. With the light selected, go to Window | Animation. The Animation View will open.
  3. To create a new animation, click on the Create button, as shown in the following screenshot:

  1. Create New Animation Clip will appear...