Author Topic: UI behind 3D space  (Read 2085 times)

UNSH

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
UI behind 3D space
« on: December 17, 2014, 07:09:17 AM »
Hi all,

I'm having a weird problem with my 2DUI. The 3D model in my game overlaps the UI when I get too close. The weird thing is that this problem stops if I add a 3DUI . I tried changing the depth of the seperate cameras, but if I put my main camera behind the 2DUI camera all of my UI dissapears. Also if I click on a button and there is a collider (with onmousedown) behind it, both the NGUI button and the gameObject collider get clicked. But the latter may be cause by another problem.

Also important I think the problems started after updating to NGUI 3.0, but I already once deleted all of my UI and started over with a fresh NGUI update, but the problem remains.

ps: I have the full version of NGUI.

thanks in advance

r.pedra

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 20
  • Posts: 131
    • View Profile
Re: UI behind 3D space
« Reply #1 on: December 17, 2014, 08:35:15 AM »
Can you provide screenshots of the configuration of your scene and cameras? (And also what you are seeing in your scene game view on different cases)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI behind 3D space
« Reply #2 on: December 17, 2014, 03:23:57 PM »
You need to use a separate camera to draw your UI. You shouldn't be using the came camera as the rest of your game. If you do use different cameras, check their layers. Only the UI camera should draw the UI layer.

UNSH

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UI behind 3D space
« Reply #3 on: December 18, 2014, 04:25:04 AM »
Sorry I found it, the clear flaggs of the camera were not set to Depth only, propably I did it by accident when shifting to 3.0 or something. Thanks for the replies.

For others the fix for the UI & mousedown overlap:
http://www.tasharen.com/forum/index.php?topic=138.0