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?
Answer by Hellium · Feb 14, 2018 at 01:04 PM
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:
Find the executable of chrome
Launch a terminal
Execute
./chrome.exe --allow-file-access-from-files
Never $$anonymous$$d my previous comment, i figured it out what i was doing wrong: i downloaded the easyphp webserver ins$$anonymous$$d of the devserver.
After that your explanation made perfect sense, thanks for helping me.
I can't believe i finally finished this altough i gotta say i have no idea how servers and hosting stuff works but i finally played this game on my browser, thanks.
Answer by lspence812 · Feb 12, 2018 at 04:33 PM
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.
Your answer
Follow this Question
Related Questions
When playing builded version of game the cameras only captures part of scene. 0 Answers
Destroying 2D terrain at runtime 0 Answers
What is the most effective way to structure Card Effects in a Single Player game? 1 Answer
Randomize questions in a quiz game 2D 0 Answers
Trouble with directing launched projectiles in Unity 2D 0 Answers