Author Topic: Losing panels after camera switch  (Read 1910 times)

Brizzler

  • Guest
Losing panels after camera switch
« on: July 09, 2013, 07:13:34 AM »
Hi,

I'm displaying a series of NGUI panels all of which work fine.
However, when I switch over to another camera and then back to 'Main Camera' on the 1st Person Controller subsequent panels don't appear.

They have been activated as I can see them in the hierarchy but they don't appear on screen.

Also, it only happens when switching back to the FPC camera, they appear no problem on the 'other' camera.

I'm using Playmaker to control all the actions - 'Cut to camera'

Any ideas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Losing panels after camera switch
« Reply #1 on: July 09, 2013, 08:47:50 AM »
Check your layers. Everything must be on the UI layer.

Brizzler

  • Guest
Re: Losing panels after camera switch
« Reply #2 on: July 11, 2013, 08:20:13 AM »
The FPC and 'other' camera were set to the default layer so I've changed them both to the GUI layer which NGUI uses but the panels still don't appear.

Anything else?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Losing panels after camera switch
« Reply #3 on: July 11, 2013, 07:37:06 PM »
FPC? Let me clarify:

The UI camera must be on the UI layer, and set to draw only the UI layer. The game camera must be on the Default layer, set to draw everything except the UI layer.

Brizzler

  • Guest
Re: Losing panels after camera switch
« Reply #4 on: July 12, 2013, 02:24:53 AM »
You said 'everything must be on the UI layer' so I changed the FPC camera and 'other' camera over to the GUI layer!!  :)

Anyway, they're all back on the default layer and it still doesn't work.

What is it that I need to do when switching back to the main FPC camera as everything is fine before this including the view from another secondary camera.


EDIT

I've set the depth of the NGUI camera to 1 (main camera at 0) and the panel now appears but disappears behind any 3D objects if I walk around.

Should I be doing anything with the culling masks on the camera?
« Last Edit: July 12, 2013, 03:53:41 AM by Brizzler »

Brizzler

  • Guest
Re: Losing panels after camera switch
« Reply #5 on: July 12, 2013, 04:19:37 AM »
Ooooh! Set the 'Clear flags' on the GUI camera to 'Depth only' and it all works fine now.

Not sure what that was all about  :o