In the Space Shooter Tutorial how do i build the game for Web on Google Chrome?

I’m currently using Unity 2017.1.1f1

From what i understand the part 16 of the Space Shooter Tutorial is outdated an the PDF that is used to update the tutorial does not mention anything about that.

Can someone enlighten me on how should i proceed?

Make sure you have WebGL added as a build target and select that to build for the web.

@ lspence812 I did, and when i tried to open on google chrome this happens:

so… since my target is google chrome the recommended answer here is to upload to a server? I have no idea where even to start with this.

For security reasons, WebGL applications can’t be launched in local. They have to be hosted on a server.

If you don’t have a server, and if you don’t want to buy one, I suggest you installing a web development environment in order to have a local server on your computer. Don’t worry, it’s very easy

You have several possibilities, depending on your OS. On Windows, you can use EasyPHP or Wamp.

Once you have installed the software, launch it and copy-paste your WebGL project in a special folder ( <path_to_wamp>/www or <path_to_easy_php>/eds-www). Then, type localhost/<webGL_folder_name>) in your browser and you are done !


Otherwise, run Chrome with the --allow-file-access-from-files flag. To do so, you can:

  1. Find the executable of chrome
  2. Launch a terminal
  3. Execute ./chrome.exe --allow-file-access-from-files