1 Reply

The body of your if statement ("if(GUI.Button(...))") will only be executed one time when you press the button. You can't draw your buttons inside the if-statement. Unity uses an immediate mode for the GUI elements. You have to execute your GUI elements every frame, so they have to be directly in OnGUI: