Application.Quit() NOT exiting BUILT game!?

I have this problem when using Application.Quit() to close my BUILT/COMPILED game; and is doesn’t exit the game; only loads the level number (which cannot be left blank)… It worked just fine before the 5.x updates. I’ve checked everywhere and searched the API Reference and Manual and still can’t find a solution. I’ve double and triple checked my code to ensure nothing was deprecated. It’s all up to date, and it just doesn’t quit like it should. I’m stumped; after 18 years of C++ Programming Experience, I’m stuck on something that should be so simple. I’ve been coding in C# for the past 2 years now; and have not encountered a problem as ridiculously frustrating as this one. The below snippet is code that had worked perfectly, and now doesn’t appear to work at all.

public bool isQuit;

void OnMouseOver(){
    if (Input.GetButtonDown ("Fire1") && isQuit == true) {
        Application.Quit(); //Quit and Close Game
    }
}

And the checkbox for bool isQuit; is Checked (TRUE) on the quit button. NOTE: There are no Debug lines because it had worked perfectly prior… I see now, that was a mistake.

I decided to create a seperate hoverScript for the quitfunction. The Application.LoadLevel(), was taking priority over Application.Quit(). Most likely a minor syntax error on my part: seeing as I had the Application.Quit() in and else if statement below Application.LoadLevel(). So since it could load the specified level, it did not have to follow the command to quit.

1 Answer

1

Same issue here. Though I’ve only been working in Unity for about a half year (all my C# experience) so I thought it might be the wrong thing to call… but, this seems to be what people recommend…
.
What it does it just minimizes the app and when the app is maximized it restarts it.