Search Unity

Does not contain a definition for `clientOwnedObjects'??

Discussion in 'Multiplayer' started by Royall, Sep 22, 2015.

  1. Royall

    Royall

    Joined:
    Jun 15, 2013
    Posts:
    120
    So Unity gives me this error when trying to retrieve the player object when he disconnects

    The docs tell me that clientOwnedObjects can be found in NetworkConnection:
    http://docs.unity3d.com/ScriptReference/Networking.NetworkConnection.html

    This however returns an error:
    Code (CSharp):
    1. void OnServerDisconnect(NetworkMessage mess) {
    2.    Debug.Log(mess.conn.clientOwnedObjects);
    3.    NetworkServer.DestroyPlayersForConnection(mess.conn);
    4. }
    And I get this error:
    I use Unity 5.1.2f1 Personal

    I simply want to retrieve the player object before destroying it so the server can save some data...
    Can anyone help please?

    Thanks
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    clientOwnedObjects is only in 5.2.

    In 5.1 there is the playerControllers list for the connection.