Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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

Discussion in 'Multiplayer' started by christianlebedev1, Dec 13, 2021.

  1. christianlebedev1

    christianlebedev1

    Joined:
    Dec 5, 2020
    Posts:
    14
    Аfter exiting the game scene in the menu, I try to create a new server, but an error pops up


    Code (CSharp):
    1.  public void DisconnectPlayer()
    2.     {
    3.         Destroy(RoomManager.Instance.gameObject);
    4.         StartCoroutine(DisconnectAndLoad());
    5.     }
    6.  
    7.     IEnumerator DisconnectAndLoad()
    8.     {
    9.         if (PhotonNetwork.InRoom)
    10.         {
    11.             PhotonNetwork.Disconnect();
    12.             PhotonNetwork.AutomaticallySyncScene = false;
    13.         }
    14.         else
    15.             yield return null;
    16.         SceneManager.LoadScene("Menu");
    17.     }
    Безымянный.png
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,022
    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.
     
  3. christianlebedev1

    christianlebedev1

    Joined:
    Dec 5, 2020
    Posts:
    14
    @tobiass
    I have already tried everything, how can I fix this error?
     
  4. christianlebedev1

    christianlebedev1

    Joined:
    Dec 5, 2020
    Posts:
    14
    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.
    Code (CSharp):
    1.   public void DisconnectPlayer()
    2.     {
    3.         Destroy(RoomManager.Instance.gameObject);
    4.         StartCoroutine(DisconnectAndLoad());
    5.     }
    6.  
    7.     IEnumerator DisconnectAndLoad()
    8.     {
    9.         if (PhotonNetwork.InRoom)
    10.         {
    11.             SceneManager.LoadScene("Menu");
    12.  
    13.             PhotonNetwork.AutomaticallySyncScene = false;
    14.         }
    15.         else
    16.             yield return null;
    17.        
    18.         PhotonNetwork.Disconnect();
    19.    
    20.     }
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,022
    Glad you found this. Yes, the SupportLogger can be useful. Sorry, I forgot to mention it.
     
  6. KeeganVR

    KeeganVR

    Joined:
    Mar 6, 2023
    Posts:
    1
    The same thing happens to me when I try to join a server I am so confused
     
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,022
    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...