Home > Mobile >  The game window freezes when calling Application.Quit()
The game window freezes when calling Application.Quit()

Time:12-06

I have put together a small project for WebGL, there is an exit button,(Application.Quit()), but when it is called, the window just freezes.

public void ExitGame()
{
   print("exitGame");
   Application.Quit();
}

enter image description here

CodePudding user response:

The Application.Quit() method is a great way to quit the game on a desktop game but it can't be use to close a browser tab for example in your case, where you are working with WebGL.

What you could instead try is to redirect the player to a new webpage when the player eventually quits the game.

CodePudding user response:

Quitting is used in desktop apps, and isn't designed for use in WebGL builds. Quitting from a WebGL game isn't possible - you can't close the window.

  • Related