O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

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

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: ...

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