Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Unity for Architectural Visualization

You're reading from  Unity for Architectural Visualization

Product type Book
Published in Sep 2013
Publisher Packt
ISBN-13 9781783559060
Pages 144 pages
Edition 1st Edition
Languages
Author (1):
Stefan Boeykens Stefan Boeykens
Profile icon Stefan Boeykens

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 to Help | Scripting Reference, which opens your default browser on the starting page of the locally installed Unity documentation, which is also accessible offline. On the first page there is a small menu to choose the language of all examples (JavaScript...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}