Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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,086
    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,086
    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,086
    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...