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 :slight_smile: Sorry for english and thx for help :slight_smile:

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.