- Home /
How to embed WebGL game on a website?
Hello everyone,
I recently updated my Unity to 5.3 and am looking to embed my first game onto my website using WebGL. I have never done this before and don't really know where to begin. In my research I have seen people say to place it in dropbox, but I don't see how that helps embed it on to my website for people to see and play.
If anyone could me out with this, I would be extremely grateful. Thank you.
Answer by Vagonn · Apr 26, 2016 at 05:05 PM
Put your entire build folder to your website (it is default). I'm not web developer but I was able to put folder to our website with filezilla. My teammate helped me to get access ftp of our site. If you know FTP it is very easy.
Your url is your website name if you put build folder directly to main folder in website. For example www.cgraf1.com. It launch index.html file. And you are done
Or if you created custom folder in main folder and build folder in this folder your url be like: www.cgraf1.com/myfolder/
Thank you @Vagonn. I will try this now, but I have a few questions.
First, does this all still apply to my website if I am using a C$$anonymous$$S, like Squarespace?
Will I be able to get ftp using a C$$anonymous$$S?
I think you will be able. Try and reply if you succeeded :)
O$$anonymous$$, so i tried to link the builder folder (which I am assu$$anonymous$$g is the folder that contains the index.html, the Release folder, and the TemplateData), to the website with the link that Squarespace said to use. This link, however, only took files and not whole folders.
I then tried to put this folder into my Google Drive, make it public, then get a sharable link through there for Squarespace. All that did was link to a big code block ins$$anonymous$$d of the actual game.
So is this where Filezilla comes in? I saw things online about linking Filezilla with SFTP, but not exactly sure what that means.
Update: I now have a link from Google Drive that when clicked it loads the Unity WebGL, but the load bar gets to 2/3 and then stops. Is this a memory issue? Something else I'm doing wrong?
Answer by PointyPigheadGames · Nov 06, 2016 at 11:34 PM
Check out this tutorial I made here. It shows how to use free hosting from Google. It is not Google Drive! That method does not work anymore. This is the modern way to host your games. I hope you find this helpful.
-Pointy Pighead Games
Thanks i'll have to try it out! Been looking for a new way to host my games.
Hey the link that you left for the tutorial doesn't work anymore. Would you be able to update that link?
Answer by hexagonius · Apr 26, 2016 at 05:33 AM
I just recently built for WebGL. it basically spits out a bunch of stuff with a leading index.html. I think if you put it on an apache or something similar that supports web GL, you can just put it onto the host.
this page mentions something at the bottom:
http://docs.unity3d.com/Manual/webgl-building.html
I'm sorry, but the link does not provide enough detail for me to understand. I am very new at this, but as soon as I get it done once, it would mean the world to me. I have a google drive that I can place files publicly, but the WebGL build provides so many files and a the UnityLoader.js that I do not know what to do with all of them. If I could have a bit more details, I would really appreciate it.
At this point, I would even settle for a link to open the game on a separate window, but would still prefer to embed.
Your answer
Follow this Question
Related Questions
Default WebGL fullscreen button not working in Firefox 1 Answer
How to use multiple unity module or unityLibrary into native android application 0 Answers
Embedding scripting language (webgl-compatible) 3 Answers
Is it possible to embed a YouTube video in Unity's WebGL build? 1 Answer
WebGL embed in asp.net mvc 2 Answers