I builed my 3D game on Web, when i click “build and run” button it opens without a problem but if i click “index.html” file i get:
“Failed to download file Build/Web.data.br. Loading web pages via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host Unity content, or use the Unity Build and Run option.”
How can i fix this?
Reason build and run works is it fires up a light web server for you, hence http://localhost… you cant open it as a file…
Unity 6 doesnt quite work like the previous versions but you can run the lightweight webserver in prior versions… by providing the correct parameters, under unity 6 it seems more grumpy and well the parameters seem to have changed as it just errors for me
1 Like
Adding to this: you can’t run build output without running a webserver. So there’s no way to simply zip and send your build to friends, it won’t work for them.
What you can do is to install the WebGL Publisher package. This allows you to upload your build to play.unity.com where it can be played by anyone. Uploading to other sites is of course also an option, like itch.io.
1 Like