Operation SetProperties (252) not called because client is not connected or not ready yet, client st

Аfter exiting the game scene in the menu, I try to create a new server, but an error pops up

 public void DisconnectPlayer()
    {
        Destroy(RoomManager.Instance.gameObject);
        StartCoroutine(DisconnectAndLoad());
    }

    IEnumerator DisconnectAndLoad()
    {
        if (PhotonNetwork.InRoom)
        {
            PhotonNetwork.Disconnect();
            PhotonNetwork.AutomaticallySyncScene = false;
        }
        else
            yield return null;
        SceneManager.LoadScene("Menu");
    }

Your client is disconnecting. This means, it will wind down the connection to the servers and this is why you can’t call operations on the server anymore and get this error message.
Make sure to not set properties, once the client leaves the room.

@tobiass
I have already tried everything, how can I fix this error?

I solved my mistake. The timeline somehow influenced the connection status and did not disconnect me from the game. I advise you to turn on the support logger to understand what the error is, thanks.

  public void DisconnectPlayer()
    {
        Destroy(RoomManager.Instance.gameObject);
        StartCoroutine(DisconnectAndLoad());
    }

    IEnumerator DisconnectAndLoad()
    {
        if (PhotonNetwork.InRoom)
        {
            SceneManager.LoadScene("Menu");

            PhotonNetwork.AutomaticallySyncScene = false;
        }
        else
            yield return null;
       
        PhotonNetwork.Disconnect();
    
    }

Glad you found this. Yes, the SupportLogger can be useful. Sorry, I forgot to mention it.

The same thing happens to me when I try to join a server I am so confused

Turn on the SupportLogger to get more insight into what the client is doing when.
The error tells you that SetProperties can only be called when the client joined / created a room. Make sure you are done with matchmaking before calling this…