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

Creating a frame-by-frame sprite animation with the Animation View


This recipe shows how to use the Animation View to create sprite animations from previously rendered (or hand drawn) frames.

Getting ready

To create a frame by frame sprite animation in Unity, you should first draw or render out the animation frames from a 3D package, combine them into a sprite sheet, and import the sprite sheet into Unity (see the Exporting a 2D sprite animation from a 3D package recipe). You can also download the provided example Unity project and go to Chapter 03 2D and user interface animation\Recipe 02 Creating a frame by frame sprite animation with the animation view directory. You will find a scene called Example.unity there, with a Coin game object that has been already animated. You can select it and go to WindowAnimation to see how the animation was prepared.

How to do it...

To create a frame by frame sprite animation in Unity, follow these steps:

  1. Select your sprite sheet asset in the Project View...