I’ve made a 3D game on unity, and I wanted to put it on a website so my friends don’t have to download it when they want to play it. The problem is, when I build it as a WebGL, there were numerous glitches with the gameplay that didn’t happen on the .exe standalone. Is there a way to run a .exe on a web browser? Because the glitches were really annoying and ruins the gameplay.
Nope… and it’s good that this isn’t possible at all. Otherwise, there would be just another entry point for malware & co.
What you can do is to find out what causes these glitches and how to fix them.
What’s weird is that everything runs fine on standalones for mac OS builds and .exes, but once I build it as a WebGL, things start glitching. It might be something that happened while it was building it, but I don’t know. I’ll have to look up more info about this glitch.
WebGL is significantly more limited than standalone builds. One of the biggest difference is no multithreading. Anything in a standalone build that would run in a separate thread is instead run on the main thread. A lot of the engine now runs in its own threads for standalone builds, even if you’re not implementing multiple threads yourself. You’re also entirely dependent on whatever resources and performance the browser allocates instead of actually having control over it.
So is there any workaround? a different type of build that can run on a browser/doesnt have to be downloaded that can work just as well?
Not from Unity. But just to be clear on the “doesn’t have to be downloaded” part, the player is still downloading the game for WebGL. You’re not saving them the bandwidth of downloading. You’re just saving them the few mouse clicks of unzipping or installing the game after the download.