How do I create a server in WebGL? When I start up the WebGL version of the game, I get this: Is WebGL networking even possible?
WebGL version cannot be server. Run one Windows instance as server. Then WebGL-instance can connect to server as client.
WebGL cannot act as a server. Use a Windows or other standalone platform build as the server. By default Unet on all platforms other than WebGL will use UDP for Unet's network transport, but WebGL is not capable of using UDP, only Websockets. So you tell the standalone build to use Websockets instead of UDP so WebGL clients can talk to it. https://docs.unity3d.com/ScriptReference/Networking.NetworkManager-useWebSockets.html
kindly tell me how to set multiplayer using WebGL ?? i upload webGL build on Domain(Server) and try to play multiplayer game by running two instances on different laptops but it didnt work for me both players cant find each other. Kindly help
You don't mention a game server they're connecting to...do you have one? Are they both able to connect to it?
i upload the build file on server and both players open the file but they cant find each other please help me
There isn't any magic - you still need a game server hosted somewhere for both players to connect to. It sounds like you've created a single player game with no networking and no game server.
You need a SERVER You will not be able to "make connection between two clients". You need a standalone build (not WebGL, instead Windows/Linux/Mac, etc) set up to act as a server which the two clients connect to. You will also need to make sure the server build is set to use websockets.
using PC/Windows/Linux it works well but i want to Make i webGL -_- it didnt work . Do u have any idea ??
nd i want to upload my game on domain(server) and make two clients to connect with each other. Any idea how to do ??
am getting this issue on executing webgl html page "Uncaught TypeError: Cannot read property ‘id’ of null " plz help me to solve this
WebGL uses websockets, you'd have to configure your standalone server build to use websockets instead of UDP in order for the WebGL build to be able to connect to it.
Clients don't connect to each other, period. Not sure if you're meaning something different, or don't understand how it works, but the clients in order to affect each other will do so through their connection to the same server.
Wanted to add to this thread that the aforementioned websocket process worked for me, but I had to use Firefox instead of Edge in order for it to work. I'm using 2019.3.0a7, and auto graphics api which when I turn off goes to WebGL 2.0.. I believe this means that it also won't work with IE and I am using Chrome 75 which also didn't work.
So I am still trying to wrap my head around all of this. I own a third party independent virtual server, I've successfully loaded and played single party games on it using WebGL. Now I want to try multiple party games hosted and ran on the website without a need for the client to download anything. In other words log on, click on the game and run from the website directly.