Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Using the Animator Controller to play sprite animations


In this recipe, we will create an Animator Controller to play 2D animations of a character. Unity's animation system is using the same principles for both 2D and 3D animation clips, which makes it quite intuitive to use.

Getting ready

First, you should have at least two sprite animations (or 2D sprite doll animations) ready. You can also go to the Chapter 03 2D and user interface animation\Recipe 04 Using the animator controller to play sprite animations directory and open the Example.unity scene. You will find an already animated Warrior game object there. If you play the game, you can use the arrow keys (left and right) to move the character. It will play 2D animations accordingly.

How to do it...

To create an Animator Controller for 2D animation, follow these steps:

  1. Import your 2D sprite sheets to Unity the same way as in the Exporting a 2D sprite animation from a 3D package recipe.
  2. Drag and drop one of the child sprites (not sprite sheets...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik