Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Nobozarb · Sep 10, 2017 at 07:04 PM · webglhostinggoogle sites

Host Unity Game on Google Sites

I have created a WebGL game that is actually kind of fun, and want to put it on a new Google Site. I know hosting on Google Drive has been taken down, but I feel there must be some way to embed an HTML page on Google Drive in Google Sites. But Google Sites tells me the selected file type is not supported. When I try using a URL embed, it shows the HTML code instead of the page. If I use a direct URL, it tells me a link will be displayed instead of the actual HTML. How do I embed a Unity game in Google Sites?

I have searched for this before, but all the answers either use the deprecated Web Player, old Google Sites, or deprecated Google Drive Hosting.

(I am using NEW Google Sites, not old Google Sites)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by orethoion · Oct 11, 2017 at 09:04 AM

Since the new Google Sites stopped supporting gadgets, the best alternative would be to insert a url that can be expanded to a mini preview of sorts. The requirements for that would be

  • Free

  • Customizable

  • Supports: HTML5 (Canvas), Javascript, CSS

  • File Hosting

  • No random overlays/icons/footers

  • Uses HTTPS (since otherwise google won’t let you have a preview)

After trying a few different web hosting services (wordpress, weebly, neocities, etc), I found that Github Pages was by far the best option. Just create a repo named [username].github.io and put your build in it, then link the url to your Google Sites page.

A few modifications to index.html a bit to make it fullscreen:

 <!DOCTYPE html>
 <html lang="en-us">
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <title> Unity WebGL Player | thing </title>
     <link rel="shortcut icon" href="TemplateData/favicon.ico">
     
     <style>
     html {
         overflow: hidden;
     }
 
     #gameContainer {
         height: 100%;
         width: 100%;
     }
     </style>
 
     <link rel="stylesheet" href="TemplateData/style.css">
     <script src="TemplateData/UnityProgress.js"></script>  
     <script src="Build/UnityLoader.js"></script>
 
     <script>
       var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Builds.json", {onProgress: UnityProgress});
     </script>
     
   </head>
   <body>
     <div class="webgl-content">
       <div id="gameContainer"></div>
     </div>
   </body>
 </html>


An example

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nobozarb · Oct 14, 2017 at 11:46 AM 0
Share

Thanks for the answer! Sorry I forgot about this question because answers didn't seem to be co$$anonymous$$g in. Editing the code didn't work (it made the game screen really tiny) but building with the $$anonymous$$imal template did. Uploading to GitHub was very helpful though.

avatar image flamehead2122 · Oct 17, 2017 at 04:36 AM 0
Share

https://ericranstrom.github.io/ericranstrom/general/unity_github_pages/ has a tutorial for setting up a github pages blog with playable unity games

avatar image orethoion flamehead2122 · Oct 17, 2017 at 05:57 AM 0
Share

While this is a good resource for making a blog on Github Pages, it is not very useful for this purpose as we are trying to put our unity games on Google Sites.

Using your method would result in a window containing a blog containing the unity game.

avatar image
0

Answer by jcowen · Dec 08, 2019 at 06:12 PM

You can now host directly on the Unity Connect site with a public URL....

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

76 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I am trying to create an online multiplayer game, but UnityEngine.Networking isn't supported with WebGL exports. What would be the best way to create a networked game for WebGL? 1 Answer

Unity WebGL builds on a Squarespace site 3 Answers

WebGL Uncaught RangeError 2 Answers

how to host webgl application on cpanel? 0 Answers

Embed a WebGL game on an old Google Sites? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges