I want that when you press a gui button that says info, it displays text and when you press again that button, you hide it. How do I do it?
Use boolean values… If button is pushed, set something to true, set that thing to false, then it shows other thing, then inverse when the other button is pushed.
Try this code:
var displayInfo: boolean = false;
function OnGUI () {
if (GUI.Button (Rect (50,50,80,80), "infoButton")) displayInfo = !displayInfo;
if(displayInfo) GUI.Label (Rect (50,200,100,200), "infoToDisplay");
}