Unity freezes trying to load scene twice

Options
I begin in the menu scene, I use PhotonNetwork.LoadLevel() to load the game scene, everything works fine.

From the game scene I use PhotonNetwork.LoadLevel() to load the menu scene, everything still works fine.

When I try to load the game scene again, this time Unity begins loading the game scene but never gets there, I have to force close the software.

I've already tried:
"Unloading" the scene, I checked if there was anything like this in the PUN docs but had no luck, maybe I'm just bad at looking.
Making sure there are no gameobjects in DontDestroyOnLoad, there's nothing.

Is this a common problem? What are some possible fixes?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Wschmidth,

    Thank you for choosing Photon!

    What PUN version are you using?
    Can you update to the latest and retry?

    If the issue persists, could you send us minimal repro steps or minimal repro project?
  • Wschmidth
    Options
    @JohnTube
    Thanks for the response, though this ended up being an issue unrelated to Photon.

    I was using a static variable in one of my scripts that caused issues once the scene loaded when the variable was already assigned. I fixed this by setting the variable to null when one of the objects is destroyed.