Make a GUI button automatically clicked down

Hi, I was wondering how I would be able to make a button automatically down without the player clicking and holding it. Thank you.

You can’t make the default button exhibit that behavior, but you can fake it by playing around with the styles. :slight_smile:

At its core, there is no magic about the appearance of a pressed button, it’s just another texture. All buttons have textures for pressed and normal states. So, when you make your GUI.Button or GUILayout.Button, don’t draw it with the default GUIStyle for a button - draw it with the GUIStyle for a textured label instead, and then replace the texture on the label manually each time the user clicks the button.

You can download the default Unity skin in this forum post:

http://forum.unity3d.com/threads/7173-Official-skins?p=84065#post84065

The button textures for pressed and normal states are in that package. Figure out which one is for pressed, and which one is for normal, and then just swap them on the label-style you draw the button with. That should give you the desired behavior.