Search Unity

Question how to execute a function when a client leaves and when a host leaves?

Discussion in 'Netcode for GameObjects' started by KristenBoyGames, May 22, 2022.

  1. KristenBoyGames

    KristenBoyGames

    Joined:
    May 23, 2021
    Posts:
    38
    how do i execute a function when a client leaves and when a host leaves?
     
  2. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    There is a
    OnClientDisconnectCallback
    you can subscribe to on the NetworkManager.