Author Topic: One NGUI.... with Multiple cameras? Virtual Hi-Five For Helping!!!!  (Read 11469 times)

devotid

  • Guest
I have a NGUI Panel anchored to the bottom of one of my First Person View cameras...... which is working nicely.  But how would i go about getting it to "travel" to the "next" camera view/camera controller? (ie. when walking its on the bottom of screen and when you get into a car......its still available at the same spot?)  I think i have about 12 different camera views available at any time.

I would just like to have this NGUI Panel work like the default Unity GUI "draw texture" option... that is always drawn in front no matter what camera is "live".  (i am mainly using NGUI because i dont understand the GUI layout functions to make the default unity GUI's buttons stay in one place when the screen size changes....lol)

Is there a way to use NGUI just for 2d screen GUI's that draw "in front" of everything no matter what camera is "live"?  I would like to be able to see the scene behind the gui also...... The GUI only fills about 1/2 of the screen.  Think of a Pause Menu......or a HUD.

NOTE: i have the GUIs all working how i want.... I just want to know how to share it between multiple cameras.

Am i missing something simple and silly?  Lol.

Any help or advise would be greatly appreciated. :)

Kevin
devotid

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
You shouldn't mix UI and a moving game camera.

Create an additional, UI-specific stationary camera instead.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Create a specific camera for UI, that has a clear flags to Depth only and put all your GUi into your own unity layer, and make sure that nothing else is in that layer.

devotid

  • Guest
@Aren....... Any reason why? it works perfectly?  isnt that what every HUD is?

i just want to make it work with other cameras. "on the fly"

@nicki: Thanks for the idea that sounds like it will work.....didnt think of messing with the actual camera settings.....i will try this



thanks again for the ideas.

Kevin

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Because your UI will clip with real world geometry, which is odd. The UI should always be on top. Using an additional UI-only camera will make sure that it's always "on top". Just do what Nicki suggested.

devotid

  • Guest
Gotchya.... ;)

I just have the camera setup so the movement is limited....and does not let the "gui" come in contact with any geometry......

Thanks for the explanation....:)

Kevin