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
About the Author
About the Reviewers

Creating animations for the button and door

Before we start working with Mecanim directly, we'll need raw animation data from which to work; that is, we'll need two complete animations, one for the button, and one for the door. When the button is pushed, the door will open. Therefore, we'll need one animation for the button as it moves inward in its socket when pushed, and then returns to its neutral position. We'll also need a door-open animation so that the door rotates around its hinge, opening outwards. The latter should play only after the button is pushed. Both of these animations may be created directly inside the Unity editor using the Animation window, as explained in the previous chapter. For this reason, I'll cover the animation process here only in brief.

To create the button-push animation, select the button object in the scene, either in the viewport or in the hierarchy, and then switch to the Animation window. This can be accessed by going to Window | Animation from the main...