Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Peacewise on November 22, 2015, 02:52:27 AM

Title: UICamera.hoveredObject is always *null* until mouse is clicked.
Post by: Peacewise 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?
Title: Re: UICamera.hoveredObject is always *null* until mouse is clicked.
Post by: ArenMook 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.
Title: Re: UICamera.hoveredObject is always *null* until mouse is clicked.
Post by: Peacewise 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.