Is it possible to connect a WebGl Unity build to a C# server using UNet?

Hey guys. So here’s the scenario:

- I have a WebGL Unity build running in a browser.
- I have a server running on a machine which is built using raw C#.
- Can I connect to the server using the Unet system? Or does the server also need to be built using Unity?

  • I know its possible using Websockets and javascript as a plugin, but I wanted to check this point above first.

Thanks for any help all :slight_smile:

The main Unity dev working on the Unet LLAPI developed a DLL for use it in projects outside of Unity to use Unet to talk to a Unity project. But Unet was deprecated years ago, so it might be hard to get this late in the game, since you had to request the DLL from Unity for your project’s use. It wasn’t just posted for general availability for some reason (probably licensing or something). I didn’t follow the DLL development close enough to remember this many years later if it specifically supported websockets in addition to UDP, but investigating those old threads would be where I’d start.

Choosing Unet right now is probably a mistake by the way. I’d look for any other solution.

Hey Joe. thanks for the reply.

Yeah I’d heard Unet was being deprecated. So it sounds like using a javascript websocket plugin is the better, more stable way to go for WebGL server client communication.

I assume with the new ‘Connected Games’ multiplayer solution, that would also require the server to be built in Unity?

Last I read the in development network solution from Unity doesn’t have WebGL support, and won’t have it in the near future.

Ah ok. Then it sounds like websockets in a WebGL build is going to have to be the way for sure.