Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ishti10 on February 08, 2014, 05:09:07 PM

Title: Depth Order and Colliders conflicts in NGUI 3.x
Post by: ishti10 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?
Title: Re: Depth Order and Colliders conflicts in NGUI 3.x
Post by: ArenMook 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.