Author Topic: Depth Order and Colliders conflicts in NGUI 3.x  (Read 1806 times)


  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Depth Order and Colliders conflicts in NGUI 3.x
« on: February 08, 2014, 05:09:07 PM »
Hi I have had an issue after converting from NGUI 2.x to 3.x

I have a collider set back at z=0 and size 10, and i have an ngui widget(with children like labels and sprites) in front of it at z= -40 with a collider of size 10. The widget is in a panel with depth-order 0. The camera also is facing such that z increasing is further away.

The problem is that when the 2 colliders overlap in x and y my mouse clicks don't register on the frontmost object being the widget, even though they are seperated in z.

But if I move the depth-order of my panel to 1 it does register the mouse clicks.
Unfortunately my drag and drop breaks if I move the depth order to 1.

Could someone help me understand why this might be happening and what are the pertinent changes in NGUI 3.x that I should be more wary of?


  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Depth Order and Colliders conflicts in NGUI 3.x
« Reply #1 on: February 09, 2014, 04:13:23 PM »
Z has no effect in NGUI 3. Only the widget's depth matters. If you are trying to do something like a widget overlay that intercepts events, just add a plain UIWidget (ALT+SHIFT+W), slap a collider on it (ALT+SHIFT+C), and resize it to the dimensions of your choice.