Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question [host migration] Assigning a new host

Discussion in 'Multiplayer' started by VLRSOFT, Nov 3, 2021.



    Feb 29, 2020
    Hello! Please tell me, at the start of the game I do the following:
    We are looking for existing free lobbies -

    If it finds it, we randomly connect to it + connect to the relay server as a client using the connection code embedded in the name of the lobby room.
    If it does not find it, we create our own lobby and start the relay server as a host.
    All this works and later the game syncs super, but if, for example, the host leaves the room (the game), then, accordingly, the clients all lose the host and throws out of the game.
    Question. Is it possible to do so that if the host leaves, a new host is assigned and the players reconnect to it without loss?

    P.S. I understand this function was implemented in UNet, but does it exist in netcode?
    Last edited: Nov 3, 2021
    webkostya likes this.