[Tutorial] How does one Unity web player?
Unity (the game engine) has the awesome ability to build games to a web player.
Here's the method I use to share my web builds:
0. Make a game.
1. Build the game for the web. Here's a guide: http://docs.unity3d.com/Documentation/Manual/PublishingBuilds.html
2. Get yourself a Dropbox account. It's free and stupidly useful. https://www.dropbox.com/register
3. Copy the folder that you built your game in to your Public folder in your Dropbox.
EDIT: Public folders aren't enabled by default anymore. To enable them click here.
4. In the folder you just copied over (the one that's now in your Dropbox) right click on the generated html file (called "WebPlayer.html" by default) and click on the Dropbox context menu and then click "Copy public link". This also works from the Dropbox website if you're away from your pc.
5. Now you can give that link to people and they'll be able to play your game :)
Tips:
* When I generate the link I usually run it through a url shortener to make it look nicer. A really awesome shortener to use is https://bitly.com/ because it's free and it also gives you stats on how many times your link got clicked.
* Sometimes your game won't run in Chrome because
Here's the method I use to share my web builds:
0. Make a game.
1. Build the game for the web. Here's a guide: http://docs.unity3d.com/Documentation/Manual/PublishingBuilds.html
2. Get yourself a Dropbox account. It's free and stupidly useful. https://www.dropbox.com/register
3. Copy the folder that you built your game in to your Public folder in your Dropbox.
EDIT: Public folders aren't enabled by default anymore. To enable them click here.
4. In the folder you just copied over (the one that's now in your Dropbox) right click on the generated html file (called "WebPlayer.html" by default) and click on the Dropbox context menu and then click "Copy public link". This also works from the Dropbox website if you're away from your pc.
5. Now you can give that link to people and they'll be able to play your game :)
Tips:
* When I generate the link I usually run it through a url shortener to make it look nicer. A really awesome shortener to use is https://bitly.com/ because it's free and it also gives you stats on how many times your link got clicked.
* Sometimes your game won't run in Chrome because
(thanks to @CorruptedHeart for pointing that out). If this happens just instruct your Chrome users to click on the shield icon in the top right hand side of the browser (in the navigation bar) and then click on "Load anyway"the website is being served over SSL but the actual content isn't.
Comments
We've been having issues with Chrome and DD recently - textures not loading properly in low-memory situations, crashes when loading savegames off our server, etc. Anybody else getting the same problems, or are we just using Unity in strange ways?
We're a couple of minor versions of Unity behind at the moment, the plan is to upgrade again this week. Although every time we thing "maybe the NaCl stuff is good now" it keeps producing something I wouldn't want to let our players near.
@dislekcia do you guys use of the built in gui system? I read that eats up a lot of memory. As for loading crashes dafuq? All this happens just in chrome?
We only use the built-in UI stuff in a couple of places to get input from the player. The login box is pretty much it, everything else is custom. One of the things that DD does differently to most Unity games is load build meshes and load textures on the fly. We're not prefabbing anything (once we got to the point of possibly needing prefabs, we already had the whole random generation stuff in, so it was just easier) and that seems to be a major source of the problems. Maybe Chrome gives you the memory you ask for at appstart and then no more?
Either way, it's a bit hacky, and I don't like this idea :P
It seems that everyone here is using it, but according to a Google search, Dropbox no longer support Public folders.
Am I insane?
Link
from the dropbox website:
"It seems you don't belong here! You should probably sign in. Check out our Help Center and forums for help, or head back to home. "
It seems that loading the HTML in Chrome, it prompts you to download Unity Web player, even though it is already installed, even with that trick of changing the HTML source in the header.
You can activate the Public Folder here
Just to clarify if anybody is having the same problems. The files HAVE to be in the public folder. If you created your Dropbox account after 4 October, you will need to activate it first using the above link and everything should work fine.
.html
.unity3d
tried that and didn't work online but in my computers dropbox directory it works, online it doesn't load.
tried putting some other files in there too.
temp folder from the unity project that was created at the same time as the .html and .unity3d files, no cigar, similarly with the application file.
Anyone got some tips for me, would love to get a web build of my prototype to the forums, since I'm moving on the 31st, which also happens to be the meet up date! Hoping to still attend though.
Thanks in advance.
Edit: What does hearting mean? It's adorable.
well I guess I'll make another [url = http://makegamessa.com/discussion/290/prototype-blockboy#Item_1]thread for this[/url] then haha :) Thanks @Yay!
Edit: Also added to the wiki (so that it has a permanent easy to find residence :) - http://makegamessa.com/wiki/index.php?title=HTML_5 )