Author Topic: Why does collider in front of UIButton not getting events?  (Read 1948 times)

arkon3

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 71
    • View Profile
Why does collider in front of UIButton not getting events?
« on: September 24, 2015, 07:45:43 AM »
I have a UIPanel on depth 5 with a UIButton on it when you press the button I enable another game object with a UIPanel on depth 7 that gets moved over the top of the UIButton. That has a number picker on it that uses a Box collider with trigger on it to know I've pressed the number picker.

So collider on top of a UIButton on a UIPanel with a lower depth than the collider.

Problem is When I press on the collider it's not seen and the button underneath is pressed instead. in Camera debug mode you can see the object under the cursor is the button and not the collider on top of it. If I move the top panel picker somewhere else it all works fine.

So My question is why is the event system not obeying the UIPanel depth? What am I doing wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Why does collider in front of UIButton not getting events?
« Reply #1 on: September 26, 2015, 04:42:04 PM »
Select the sprite you think should be getting the event and double-check it having a collider. Placing a collider on a panel won't work. It must be an actual widget. Also double-check which panel it belongs to. Open the Panel Tool and select the widget -- it will highlight the panel it's drawn by.