Author Topic: Why would last hit / hovered object = UIRoot if it has no collider or panel?  (Read 2095 times)

traderjoe

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 3
    • View Profile
After upgrading to the newest version from 4 or 5 back I've noticed that UICamera.hoveredObject is never null so if it isn't over anything else it now reports UIRoot while previously it ignored UIRoot. I checked debug and last hit is also UIRoot if nothing else is hit.

All my widgets have panels so a panel isn't being added to the UIRoot and it reports only the UIRoot script in both debug and default inspector. Any other reason for UIRoot to always grab events?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
If you don't set a fallThrough object, one is now set for you. It was needed for the new generic event delegates to work (UICamera.onClick etc). Change your (UICamera.hoveredObject == null) check to be (UICamera.hoveredObject == UICamera.fallThrough) instead.