Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question OnDisconnect callback for clients?

Discussion in 'Netcode for GameObjects' started by daniel_lochner, Jul 1, 2021.

  1. daniel_lochner


    Jun 9, 2016
    Hi there,

    Are there any callbacks for when a player is force disconnected by the host? I need players to return to the main menu once kicked, but it seems OnDisconnect isn’t invoked on the client when they are disconnected.

    I tried sending an Rpc to the client to disconnect themselves when kicked, however this throws an error (and also doesn’t seem like a great approach).

    Thanks for your time!
    Last edited: Jul 1, 2021