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

Switching between cameras


While previous examples always used a single camera, apart from the mini-map, you can dynamically change cameras using scripts. You could modify their Depth parameters, so another camera is drawn above the others, but you could also toggle their state. In a more elaborate setup, you could switch between different cameras, for example from first person to third person perspective or to a dedicated Point-of-View (POV) camera to display a particular viewpoint. It is also a way to toggle between user-driven navigation and a pre-animated camera. The following steps show how to perform this:

  1. Prepare your scene with a few camera objects created and positioned in different places. Ensure that only one camera has an active Audio Listener component, to avoid warnings in the console log.

  2. Create a new C# script and name it switchCamera. Add a public variable, cameraList, to contain a list of available cameras, using an array. An index variable is used to keep track of which camera...

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}