- Home /
Question by
Crispinator · Jul 19, 2013 at 06:21 AM ·
guitexturegui-buttongui-textgui-window
Error : Expressions in statements must only be executed for their side effects.
I am trying to create a menu. I don't see what I am doing wrong. Here is my script. I am not worried about the resume section yet though.
function Start () {
}
function OnGUI() {
GUI.Box(Rect(0,0,100,90), "Menu");
if(GUI.Button(Rect(10,60,80,20), "Quit")) {
Application.Quit;
}
}
Comment
Best Answer
Answer by robertbu · Jul 19, 2013 at 06:22 AM
You are missing the '()'. It should be:
Application.Quit();
Thank you! I was looking at that script for two hours. I can't believe it was that obvious.
Your answer
Follow this Question
Related Questions
GUI Button overlay separate from main camera 1 Answer
Detect Touch on GUI.Button in Script? 1 Answer
2 Position GUI Texture Rocker Switch 0 Answers
GUI Button not displaying an icon 3 Answers
How Do I Make GUI ON Off Button with 2 Button States 3 Answers