

In the dialog box, select WebGL from the Platform list, then select Player Settings….


Build player optionsĪccess the WebGL options via the in the Build Settings dialog box. data files accessible because the server needs to provide these files to clients.

This is required on a PC to allow execution of the build. You can also run Chrome with the -allow-file-access-from-files command line option to enable it to load content from file: urls. If you use Unity’s Build & Run command (menu: File > Build & Run) then the file will be temporarily hosted in a local web server and opened from a localhost URL (this avoids the security restrictions). For security reasons, Chrome places restrictions on scripts opened from local file: URLs, so this technique will not work. You can view your WebGL player directly in most browsers by simply opening the index.html file. See the comments on Distribution size below.)Ī MyProject.js JavaScript file containing the code for your player.Ī m file containing a binary image to initialize the heap memory for your player.Ī MyProject.data file containing the asset data and scenes.Ī UnityLoader.js file containing the code needed to load up the Unity content in the web page. (Note that if you make a release build, files in this folder are compressed and have a. The Development or Release folder contains the following files (the MyProject file name represents the name of your project). See the User Manual page on WebGL templates for more information. When you build a WebGL project, Unity creates a folder with the following files:Īn index.html file which browsers can navigate to load your content.Ī Development or Release folder containing your generated build output files (which folder depends on whether you do a development build or not).Ī TemplateData folder (at least when building with the default template), containing the loading bar and other template assets.
