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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question OnDisconnect callback for clients?

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

  1. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    146
    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