O'Reilly logo

Unity 2D Game Development Cookbook by Claudio Scolastici

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up an Animator

Double-click on Packt_Animator from the Project panel to open the Animator panel in Unity. If you messed up a little with it, delete anything except the default Idle node.

How to do it...

  1. Create three new empty states by right-clicking anywhere in the Animator window, then select Create State and Empty, as shown in the following screenshot. Name them runRight, runLeft, Idle and Jump.
    How to do it...
  2. Add the run animation clip to both runRight and runLeft states, as shown in the following screenshot:
    How to do it...
  3. Lastly, add the jump_pose clip to the Jump

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required