Author Topic: Switch between cameras in game  (Read 4324 times)

terence

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Switch between cameras in game
« on: April 16, 2012, 01:39:00 AM »
I am using a simple 2D UI but I need to have multiple in game camera (i.e. I deactivate the main camera, set another camera for conversations etc). Right now when I 'switch' camera, the UI goes with it. Can I get the Ui to use the new camera setup?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch between cameras in game
« Reply #1 on: April 16, 2012, 01:41:49 AM »
Unparent the UI from your camera, and it won't move with it.

terence

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Switch between cameras in game
« Reply #2 on: April 16, 2012, 03:45:15 AM »
Hmmm..not sure if I get you..Right now my Hierachy looks like this:

Cameras (Only 1 active)
->Main Camera
->Mouse Orbit Camera

UI Root(2D)
->Camera
-->Anchor
--->Panel
-----><Uis>

when I switch between the main camera and the mouse orbit camera, the UI dissapears (I am assuming that there is some late binding happening between the UI camera and the main camera).

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch between cameras in game
« Reply #3 on: April 16, 2012, 09:25:12 AM »
Oh, I see. You need to make sure that Main Camera's Depth matches your Mouse Orbit Camera's Depth, and that their clear flags match as well.