Operation SetProperties (252) error on scene load after game - can't find origin

Options
Hello,

After joining a room, playing a game and returning to the menu and calling PhotonNetwork.LeaveRoom(), I am greeted with Operation SetProperties (252) not called because client is not connected or not ready yet, client state: Leaving. I have looked everywhere in my code and I cannot find what is causing the issue as from what I can see I am not trying to use PhotonNetwork when the menu is first loaded. This does not happen the first time the menu is opened before connecting to Photon.

The stack trace is:
Operation SetProperties (252) not called because client is not connected or not ready yet, client state: Leaving
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2297)
Photon.Realtime.LoadBalancingClient:CheckIfOpCanBeSent(Byte, ServerConnection, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2233)
Photon.Realtime.LoadBalancingClient:OpSetPropertiesOfRoom(Hashtable, Hashtable, WebFlags) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1897)
Photon.Realtime.Room:SetCustomProperties(Hashtable, Hashtable, WebFlags) (at Assets/Photon/PhotonRealtime/Code/Room.cs:397)
Photon.Pun.PhotonNetwork:SetLevelInPropsIfSynced(Object) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:2048)
Photon.Pun.PhotonNetwork:NewSceneLoaded() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:1346)
Photon.Pun.<>c:<Start>b__13_0(Scene, LoadSceneMode) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:125)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

Does anybody know how I can find the origin past "UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)" or any other ideas what it may be?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited January 2021
    Options
    Hi @AConfusedPerson,

    Thank you for choosing Photon!

    Are you calling PhotonNetwork.LoadLevel at the same time or just after calling PhotonNetwork.LeaveRoom? You shouldn't. Outside of rooms just use regular Unity scene loading as you don't need to sync scenes in this case.
    This also should be happening on the master client only right?
  • Hello,

    This is just on the master client it seems, yes. I wasn't using PhotonNetwork.LoadLevel just the regular Unity scene loading but from what you said I've tried a few things and what seems to have worked is disabling PhotonNetwork.AutomaticallySyncScene before the scene change as it should never been left on anyhow.

    Thank you!