[Tutorial] Launcher scene doesn't unload

Options
Hi, I went through the quickstart tutorial and set up the 4 room battle. After I quit the application the Launcher scenes from runtime stays in the scene tree as "Laucher (not loaded)". Sometimes there are even 2 of those scenes in addition to the open Laucnher scene. When I switch to edit another scene it goes away but when returning to the launcher it is gone.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @firegate666,

    Thank you for choosing Photon!

    I assume you use PUN2.
    Find calls to LoadLevel in OnLeftRoom or OnDisconnected Photon callbacks. Those should not be called in case ConnectionHandler.AppQuits is true.
    Otherwise, check if you have LoadLevel calls inside OnApplicationQuit or OnDisable or OnDestroy Unity callbacks.
    The idea is that LoadLevel should not be called when the application is quitting.

    Replace:

    PhotonNetwork.LoadLevel("Launcher");

    with:
    if (!ConnectionHandler.AppQuits)
    {
        PhotonNetwork.LoadLevel("Launcher");
    }
  • Thank you, that was it!