Search Unity

Third Party Disconnecting Based on Player Role (Client/Host, Mirror)

Discussion in 'Multiplayer' started by Simplisticated_Development, Sep 21, 2023.

  1. Simplisticated_Development

    Simplisticated_Development

    Joined:
    Jun 26, 2023
    Posts:
    76
    Hello all-

    So I have been making a game in Unity Mirror. The experience has been pretty good overall, but now I have run into an issue-

    There are two buttons I have in my project. One functions to terminate the host, and one functions to terminate the client.

    So basically when you host a server, you can click the button which terminates the host (you are then transported to the offline lobby). As a client, when you click the end client button, you are taken back to the lobby, but the server doesn't end.

    So my question is this: how do you have the host termination button show for the host but not for the client? And how do you have the end client button not show for the host? I cannot find any good documentation and I am not sure where to start solving this issue.

    Hope I was clear enough and I thank anyone who can give a solution in advance.