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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Unity WebGl Multiplayer game.

Discussion in 'Multiplayer' started by fabledxx, Dec 23, 2022.

  1. fabledxx

    fabledxx

    Joined:
    Jul 24, 2020
    Posts:
    8
    Is it possible to make a multiplayer game in WebGl using unity, without having to recreate almost all the tools that are in the gaming multiplayer services and netocode, and without having to learn another programming language?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,599
    WebGL networking runs on WebSockets and I‘m not 100% sure whether this works with UGS. With NGO you need to use the WebSockets transport which is a community supported transport.

    For certain you cannot have webgl instance be the host or server, just in case you didn‘t know.
     
    fabledxx likes this.
  3. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    343
    Unity Transport 2.0 has support for WebSockets, which is an alternative to the community-supported transport. However, this version is only supported on Unity 2022.2 and later (the community transport has wider editor support I believe).

    Unity Relay was also recently updated to support WebSockets, but note that this is still experimental (and undocumented). Also currently the only way to leverage this support is through Unity Transport 2.0, which means using 2022.2+. I believe the Lobby service should also work on WebGL, since we got Boss Room working on that platform.
     
  4. wanlwanl

    wanlwanl

    Joined:
    Jul 7, 2022
    Posts:
    7
    I think Azure Web PubSub Transport is just for you, which is based on unity netcode, transport protocol and websocket, the only thing you need to do is to install and select the new transport. Here's the quick start video (2 min)