Author Topic: Collider on Top?  (Read 1278 times)

aholla

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 40
    • View Profile
Collider on Top?
« on: August 27, 2014, 05:56:59 AM »
Hi, I would like to add a Box Collider to a game object which has a Unity2DSprite (not ngui) that covers the whole screen and therefore disables all of the NGUI elements.

Currently the NGUI buttons still receive the clicks although the is a collider above it.

What do i need to do to make this collider capture the events so that ngui does not?

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Collider on Top?
« Reply #1 on: August 28, 2014, 08:15:21 PM »
When the UI camera is set to UI event mode, all raycast results are sorted by widget depth. Unity2D sprite doesn't have a widget component, so it's going to be dead last.

The only way to resolve this properly is to use an NGUI widget covering the screen instead. ALT+SHIFT+W, ALT+SHIFT+C.