Author Topic: OnClick/Hover with overlapping colliders  (Read 3306 times)

jrhee

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 13
    • View Profile
OnClick/Hover with overlapping colliders
« on: September 03, 2014, 05:17:23 AM »
Hi,

I have a button which is contained in a parent widget that changes color on hover.

I've set the depth of the button to greater than the parent widget so clicks register, but this breaks the parent's OnHover color changing when the cursor's within the button's bounds.

Is there a simple way around this? The easiest way I've found was to set the parent as the button's tween target with matching colors, but this prevents me from color tweening on the actual button.

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClick/Hover with overlapping colliders
« Reply #1 on: September 03, 2014, 11:51:47 AM »
You can try to UIForwardEvents on the child to the parent.

jrhee

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 13
    • View Profile
Re: OnClick/Hover with overlapping colliders
« Reply #2 on: September 03, 2014, 08:04:26 PM »
Perfect, thanks.