

On some servers you need to explicitly make. This is required on a PC to allow execution of the build.

Alternatively, you can run Chrome with the -allow-file-access-from-files command line option which allows it to load content from local file URLs. To work round Chrome’s restrictions, use Unity’s Build & Run command ( File > Build & Run) the file is then temporarily hosted in a local web server and opened from a local host URL. However, for security reasons, Chrome places restrictions on scripts opened from local file URLs, so this technique does not work in Chrome. You can view your WebGL player directly in most browsers by opening the index.html file. See documentation on deploying compressed builds for more information The contents of the *.unityweb files in the Build folder may be compressed with gzip, brotli or may be uncompressed, depending on the Publishing Settings. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. Think of each unique Scene file as a unique level. Note that this file is only generated for multi-threaded builds.Ī file containing the Asset data and Scenes A Scene contains the environments and menus of your game. JSON may contain additional Module parameters, such as the splash screen style or the initial size of the memory heap.Ī file containing the JavaScript runtime and plugins.Ī file containing the WebAssembly binary.Ī file containing a binary image to initialize the heap memory for your player. JSON file contains URLs of all the other build files, which can be absolute or relative to the location of the JSON file. The URL of this JSON file is provided as an argument for the Unity Loader when the build is instantiated.

#Unity webgl player chrome code
The Build folder contains the following files (the MyProject file name represents the name of your project).Ī UnityLoader.js JavaScript file containing the code needed to load up the Unity content in the web page.Ī MyProject.json JSON file containing all the necessary information about your build.
#Unity webgl player chrome manual
See the User Manual page on WebGL templates for more information.Ī Build folder containing your generated build output files. The build template folder is normally used to customize the appearance of the build while loading. See in Glossary a WebGL project, Unity creates a folder with the following files:Īn index.html file which browsers can navigate to load your content.Ī TemplateData folder (when building with the default template) containing the build logo, loading bar and other template Assets. When you build The process of compiling your Project into a format that is ready to run on a specific platform or platforms.
