Unity WebGl Multiplayer game.

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?

1 Like

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.

1 Like

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.


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)

1 Like