Time for action - meet me at camera two

In order to pull off this foreground/background effect, we'll need two cameras. Let's create the second camera and set it up to look at the hallway.

  1. In the menu, select GameObject | Create Other | Camera.
  2. Rename the new camera hallwayCam.
  3. Change the Transform settings of hallwayCam to:
    • Position: X:6.5, Y:1, Z: -31

      The hallwayCam jumps to one corner of the hallway model.

  4. Select the hallwayCam in the Hierarchy panel.
  5. In the Inspector panel, adjust the following settings:
    • Clear Flags: Solid Color
    • Depth: -1
    • Culling Mask: nothing (This deselects everything in the culling mask list.)
    • Culling Mask: hallway (This selects only the hallway layer, which contains our hallway model.)
    • Flare Layer: unchecked/removed
    • Audio Listener: ...

Get Unity 3D Game Development by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.