Search Unity

Resolved "Transfer" input control (mouse) around different users.

Discussion in 'Lobby' started by Ggad, Apr 21, 2022.

Thread Status:
Not open for further replies.
  1. Ggad

    Ggad

    Joined:
    Jan 22, 2015
    Posts:
    10
    Hello guys;

    So, our client requires us to create an environment where up to 4 users connect and interact with a 2D scene (WebGL), the idea is that only one user at a time has the control of the input (mouse) while the others see what he is manipulating. At any point, the user that is in control should be able to "transfer" the control to any of the other 3 users. Other services that are required for this environment are chat and video chat.

    I wanted to know if Unity Multiplayer services are what we should be looking into.

    Thanks in advance, David.
     
  2. emilyryan

    emilyryan

    Unity Technologies

    Joined:
    Nov 22, 2019
    Posts:
    129
    Hello David! I apologize for the delay in our response. Unfortunately, we do not support WebGL, so Lobby may not be a good fit for your project. However, I will take note of your post to help gauge community interest for WebGL support.

    Regarding the concept of transferring hosts however is possible. We do offer that capability if you are using Lobby with our Relay SDK. You can learn more here: https://docs.unity.com/lobby/host-migration.html

    Thanks for your time and we apologize for any inconvenience!
     
  3. veleek_unity

    veleek_unity

    Ben Randall Unity Technologies

    Joined:
    Aug 25, 2021
    Posts:
    59
    FYI David: While the Lobby service does not explicitly support WebGL and is not tested with it, there's nothing in the service that should break when using WebGL. There are other UGS services where that's not true (such as Relay which depends on UDP sockets, not supported by WebGL at the moment), but for Lobby you may be fine to just go ahead and use it.

    In terms of transferring control, the scenario that you're describing is more of a real-time action as opposed to something that would be stored in the lobby data, so the host migration logic in Lobby is not what you would want to use (that's intended more for dealing with disconnected clients).

    You would use Lobby to get the users connected together (and help with setting up Voice Chat using Vivox integration with Lobby), and then after they're connected using some other mechanism, you would transfer data about the current "owner" of the mouse using that connection.
     
    emilyryan likes this.
Thread Status:
Not open for further replies.