How to host a Unity web-game with Google Drive

[Update Jan 2017] Google stopped hosting links from Google Drive a while ago, so this post is basically useless now.

[UPDATE: Dec ’14] Hosting Unity games on Google Drive has recently stopped working (at least for me). Even when I follow Google’s new instructions for getting the hosting link, Unity games don’t load from Google Drive. This includes games that were previously hosted and used to work. So I’m afraid it is no longer possible to rely on Google Drive to host Unity games. Your mileage may vary.

[Update: Jan ’14] It seems Google thought it would be a good idea to change Google Drive’s interface a little bit. So I updated the tutorial to match the new interface.

In this tutorial, I’ll show you how to host a game made with Unity3D on Google Drive. This tutorial assumes you know what the Unity Web Player is. I have seen a few results on how to host a Unity web-game from Dropbox, but I personally couldn’t find one about hosting from Google Drive. I wanted to host a Unity3D game from Google Drive to present to the Ludum Dare game dev competition.

Assuming you made your Unity game and you’re ready to share it with people, you first go to “File -> Build Settings”. Under “Platform”, select “Web Player”. You can choose to have your game streamed, if you want. If it’s small, you probably don’t need to.

Screen Shot 2013-08-26 at 8.38.06 PM

Then click “Build” on the bottom right corner. Choose a place to save the build. Whatever you choose, you should see an .html file and a .unity3d file when done building. You should put these 2 files into a folder for convenience (in case Unity doesn’t do it).

You can now upload the web-game build on Google Drive either by using the desktop app (for Mac or Windows) or upload on the Google Drive website.

It’s important that you upload the web-game in the Public Share folder in order for people to play your game online.

Screen Shot 2013-08-26 at 9.04.53 PM

It doesn’t matter where in the Public Share folder you upload.

If by chance you don’t have a Public folder, you’ll have to make one. To do that, press the Create button on the website and select Folder. You can name it whatever you want, but for clarity it should be called something like “Public”. Then you right-click on your new folder and select “Share…” → “Share…”

Share-share

The Share Settings window will pop up. Under “Who has access”, press “Change…”

sharesettings

A new window will show 3 choices. Select “Public on the web”, and click the green Save button. Now that your new public folder is ready, you can upload the needed files.

Once you upload the game, go to the folder where you uploaded the files and make sure the Details and Activity side-panel is open. (It’s the “i” button on the top right.)

sidepanelButton

The Details and Activity side-panel opens. Be sure to click on your game’s HTML file so that its details are exposed on the Details side-panel. (Click the checkmark box, not the file link.)

unityhtmlClick

The Details side-panel will show details about the HTML file. Scroll down to “HOSTING” and you will see a web link to access the game. Unfortunately, Google will not allow this link to be right clicked, so you’ll have to left click it.

detailsSidePannel

It should open in a new tab. From what I experienced, the game does not show up until you reload the page. Once reloaded, your game should load and you can simply copy the web link from the URL bar of your browser.

That’s all there is to it! Test that web link on some browsers, and you should be able to play your game online. Share the link with friends, or submit it to a game jam, or whatever you want. Enjoy!

Advertisements

24 thoughts on “How to host a Unity web-game with Google Drive

  1. Thumbs up.
    I have made a game and hosted it by Google drive.
    How to store and update highscore (game is in Google drive) ?

  2. sadly, can’t make that work for me. when I open html, it always appears the “unity web player install now thingy”

    • What web browser are you testing? If the Unity Web Player is not installed for some reason, you can download it here (Mac and Windows only): https://unity3d.com/webplayer

      Assuming it’s already installed, try reloading the page. If that doesn’t work, the web player might be disabled on your browser. From my testing of Chrome and Safari, I saw both browsers asked me whether to run or trust the Unity Player plug in. You may have to go into your browser’s plugin settings to enable Unity Web Player.

      • Sorry for taking so long to reply… Yes I have the webplayer installed. I realoaded the page numerous times and it still wont work… Here’s the link https://googledrive.com/host/0B2yXDxu1WXqTbk5QRzNGVm16bk0/ytte.html if it works for you nice….
        Btw when I load that page on chrome it never asks if I want to execute always or just one time whic is weird.
        About what you said about plugins, even after reintalling unity webplayer, it does not appear on chrome’s extensions

        • I’m glad it worked out for you. However, when I click on the Google Drive link you gave, I get Google’s 404 error page (the one with the broken robot). Is your game in a public folder?

          And as for checking Chrome’s plugins, they are not the same thing as extensions. You should see a listing for “Unity Player” at chrome://plugins/

  3. Pingback: How to host a Unity web-game with Google Drive | professionalgame

  4. its very helpful. thanks 🙂
    but there’s little problem in uploading streaming assets . any one have knoledge about it plz

    • I know about StreamingAssets, but I haven’t worked with them on a web-player-related project. My guess is that you would have to host the web player build on a server yourself (as in, not with Google Drive). You can try Kongregate or Wooglie, or even host it on your own website, but I don’t know how to do those things. You might also want to look up how to host Unity web games that utilize StreamingAssets. I hope that helps.

    • I have never done development with Facebook technologies, so I’m afraid I don’t know how to help.

      As for “servers”, you could take a look at Kongregate or Wooglie (assuming that’s what you meant by server).

  5. Pingback: EGaDS! Game Jam 2014 – The Rundown | Electronic Game Developers Society

  6. Pingback: Status Report #57 (Fish Feaster's Retirement, Finished Enemy Scripts, & Unicorn Quest Brainstorm) - Blog by TonyYotes - IGN

    • Although I don’t have the exact same problem as you, I also cannot get Unity games to run off Google Drive anymore. I’m afraid Google Drive is no longer a possible solution for hosting Unity games. Try something like Kongregate.

Comments are closed.