Search Unity

Question How to know which client disconnected?

Discussion in 'Netcode for GameObjects' started by lavagoatGG, Feb 17, 2023.

  1. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Hello,
    When a client disconnects, the functions subcribed to the OnClientDisconnectedCallback are called and I get the id of the disconnected client. My question is, from this id, how do I get the index of the client in the client list? I want to delete the gameObject that represents him in the lobby (before the game starts).
    Because the client has already disconnected, he won't be on the new connected clients list.
    I saw in the documentation that the relay will mark him as disconnected on the lobby but I didn't find how to access that property.