O'Reilly logo

Unity 5.x Animation Cookbook by Maciej Szcześnik

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

How to do it...

To create automatic doors, follow these steps:

  1. Select your Door Frame game object, and add an Animator component to it. To do so, click on the Add Component button in the Inspector and choose Animator. Make sure to add the component to the Door Frame instead of the Door (the parent instead of the child). Set the Update Mode of the Animator component to Animate Physics.
  2. With the Door Frame game object selected, go to Window | Animation to open the Animation View.
  3. Create a new Animation Clip and call it Closed; this will be our animation for the closed door. To create a new clip, click on the drop-down list below the playback buttons and choose the Create New Clip option.
  4. Click on the Add Property button and find your Door ...

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