Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

    Unity Technologies

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