- Home /
Application.Quit(); dosen't work properly with GUI?
I have problem with Application.Quit(). I try something like that:
if (GUI.Button ( new Rect(Screen.width * .25f, Screen.height * .9f,Screen.width * .5f, Screen.height * .1f), "Quit"));
{
Application.Quit();
}
i build a game, run and game instantly quit. When i delete Application.Quit(); everything work's fine. I use new unity 5 personal 64bit on windows 8.1 and game Build for windows. Maybe its other way to make "Quit button" ? Im start learning unity so be a understanding :) Sorry for english and thx for help :)
Answer by Landern · Mar 09, 2015 at 03:11 PM
Remove the semi-colon at the end of your if statement which is terminating the statement and executing the block of code with application.quit in it instead of evaluating the if and running if true.
Your answer
Follow this Question
Related Questions
Android app not closing complete. 2 Answers
Proper way for Quit Application 2 Answers
adjust GUI.label to the full width of the screen 0 Answers