Book Image

Unity Animation Essentials

By : Alan Thorn
Book Image

Unity Animation Essentials

By: Alan Thorn

Overview of this book

Table of Contents (14 chapters)
Unity Animation Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a door-open Mecanim graph


Everything shown so far for creating a push-button animation can be repeated for a door-open animation, which may be launched using a trigger. Consider the following screenshot, with a complete Mecanim graph for a door. It features an Idle state (door closed), and this transitions to a door-open animation, activated by the OpenDoor trigger.

A complete Mecanim graph for the door

The door-open graph can be tested, much like the push-button graph. Just select the door object in the Scene or Hierarchy panel, play the game, and then click on the Door Open trigger in the Parameters panel of the Animator window. The door should open in response.

Testing the door-open animation