Author Topic: UICamera.hoveredObject is always *null* until mouse is clicked.  (Read 2053 times)

Peacewise

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 12
    • View Profile
UICamera.hoveredObject is always *null* until mouse is clicked.
« on: November 22, 2015, 02:52:27 AM »
My problem: when I load a new scene / level, UICamera.hoveredObject is always NULL until I input some kind of mouse button event (basically, until I click the mouse). Once I click the mouse, then UICamera.hoveredObject properly returns what I expect -- either the mouse hovered UI element, or UICamera.fallThrough.

What might I be doing wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.hoveredObject is always *null* until mouse is clicked.
« Reply #1 on: November 25, 2015, 05:15:27 PM »
Hovered object is set when the mouse hovers over something. Clicking is not needed. If this didn't work, then buttons would not get highlighted. Try enabling the 'Debug' option on the UICamera.

Peacewise

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UICamera.hoveredObject is always *null* until mouse is clicked.
« Reply #2 on: November 27, 2015, 02:28:44 PM »
Thank you Aren, that helped. My build target is iOS though I'm testing on PC, so I see that the "Scheme" is set to touch until mouse input is received and then it smartly changes to "Mouse". It all looks intentional. I was just unaware it worked like this.

Thank you for your help.