Running Local Unity WebGL Build in browser
All major websites have stopped support for local webGL file opening. So, if you are a Unity developer you have 2 options, either
-
Option 1: Instead of just Build, Click
Build and Run
this will run a local server to localhost your webGL app and will allow it to run in the browser, but if u close it you can't run it without using option 2! -
Option 2: run a local server manually! no, you don't need to install xampp or wamp. Assuming you have python installed in your system, go to your build folder, open it in
cmd
orPowerShell
. and typepython -m http.server
press enter and leave it that way. This will start a very lightweight server on your local folder, making it the root directory, if you go to your browser and typelocalhost:8000
you will see your local webGL file running as it should !! Cheers !!