O'Reilly logo

Unity for Architectural Visualization by Stefan Boeykens

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

Triggering doors and elevators

We will now write a simple script that is directly applicable in our example project and extend it afterwards to be more generic and reusable, using parameters.

Doors and elevators are typical interactive elements in buildings. Most buildings have no other moving parts. To rotate a door manually or to use scripting is not that different. However, there are a few tricks to get it correct. These are as follows:

  1. Create a plane GameObject, positioned in the origin. Add a simple Cube, and name it DoorLeaf. Set its position to X=1, Y=1.5, Z=0 and scale to X=2, Y=3, Z=0.1. This ensures that the lower side corner of the door leaf is sitting in the center or our scene.
  2. Load the local documentation from the menu by navigating ...

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