Manually active and/or hover a button

I need to do something to the effect of ‘button.hover = true’ via script.
I’ve built a menu containing buttons, but I don’t use the mouse and instead am using arrow keys.
Anyone know how offhand?

Yes,

instead of the using GUI.Button, you’ll have to use the low-level GUIStyle.Draw method and alter the 3rd (“isHover”) parameter.

Thanks from me too! :wink:

NP! :slight_smile:

GUIStyle.Draw
is one of the best kept secrets of Unity.

It isn’t documented at all, and this method is what GUI.X methods are wrapping around.

I personally barely use GUI.X methods at all (I’m keeping my own list of Rects for calculating mouse-overs, no need for GUI.Button to know what’s being clicked…).