When a user clicks a button in my game, I call Unity's native Application.Quit() to close my game. The call is directly on the button press, with no coroutines or intermediate processes that sit between the press and the call.

In a standalone build of my game, after the button press, it takes around 2 seconds for the window to close. Ideally, I'd like the window to close near immediately, as it does in other Unity games I've played.

Why might Application.Quit() take so long to close the window, and how can I speed it up so that the window closes immediately?

For what it's worth, I am running Windows 10 on a Razer Blade 15 w/ 10th gen core i7. The game is a simple platformer w/ no networking or external integrations.

  • 2
    \$\begingroup\$ You might want to attach a profiler and see what happens and how long it takes when you call Quit... \$\endgroup\$
    – Vaillancourt
    Feb 28 '21 at 1:37

You must log in to answer this question.

Browse other questions tagged .