Search Unity

Resolved Checking on client if you got disconected

Discussion in 'Netcode for GameObjects' started by lavagoatGG, May 7, 2023.

  1. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    How can you check on your client if you got disconnected after your internet connection was unstable or the host kicked you out?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,826
    By implementing the OnPlayerDisconnected event on the client.
     
  3. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    OnCLientDisconnected?
     
  4. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Currently I am removing the callback on OnNetworkDespawn and it isn't getting called on the client. Should I move it?
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,826
  6. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    Fraccas likes this.
  7. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    229
    Thank you. I missed that line when reading this message
     
    Mj-Kkaya likes this.