Author Topic: Trying to have 2D gui behind AND on top of 3D cam  (Read 3160 times)

smax

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Trying to have 2D gui behind AND on top of 3D cam
« on: March 07, 2014, 08:11:03 AM »
Hello there,

That might be a newbie question, but i tried the included Camera setup (see image):

The B Camera is the 3D Camera (Skybox clearflag)
The A and B Camera are gui layers masks and DepthOnly clearflag (inside the ngui 2D root)

I can't have the B Camera displaying inbetween A and C. (A takes over B whatever i do, and C correctly draw on top)
I want GUI behind (background) the 3D and GUI on top of the 3D(buttons and all)

Any idea on how to set that up ? what I am doing wrong ?
I am in latest NGUI version (3.50)

Thank you very much,

SMaX

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Trying to have 2D gui behind AND on top of 3D cam
« Reply #1 on: March 07, 2014, 10:16:08 AM »
3.5.0 isn't the latest -- 3.5.3 is the latest on the Asset Store.

Typical setup is like this:

1. Game camera (perspective or orthographic, depends on your game). Depth of 0, clear skybox.
2. UI camera (orthographic). Depth 1, clear depth.

There is no need to have a third camera at all. Why would you? If you want something to be drawn on top of your UI, just create a new panel and give it a higher depth.