Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Putting my unity3d game on my own website.

Discussion in 'WebGL' started by lernoh, Mar 7, 2019.

  1. lernoh

    lernoh

    Joined:
    Oct 12, 2017
    Posts:
    3
    Hi! Can someone tell me how to launch my 3d game on my own website (with it's own hosting)?
    I've already compiled the game for WebGL and I have my sites folders. Can anyone tell me step by step how should I act the game to be launched exactly at the page that I want?
     
  2. dnsmnds

    dnsmnds

    Joined:
    Mar 25, 2015
    Posts:
    16
    Hey,

    After you built that on WebGL you can see index.html and how it load the game.
    You gonna need to use the folders Build and TemplateData.

    Here one instance index.html:

    <!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</title>
    <link rel="shortcut icon" href="TemplateData/favicon.ico">
    <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/YourGameName.json", {onProgress: UnityProgress});
    </script>
    </head>
    <body>
    <div class="webgl-content">
    <div id="gameContainer" style="width: 500px; height: 600px"></div>
    <div class="footer">
    <div class="webgl-logo"></div>
    <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
    <div class="title">YourGameName</div>
    </div>
    </div>
    </body>
    </html>
     
  3. aquilis007

    aquilis007

    Joined:
    Aug 11, 2016
    Posts:
    6
    Friends could clarify this question better, already tried many ways and could not.
    My site is wix and I use the DropBox to allocate the files, all I got is white screen informing that it was not possible to access the dropBox.
    Here is an image and another question, what code should I put in this field?

    thank you;
     

    Attached Files:

  4. TheRoccoB

    TheRoccoB

    Joined:
    Jun 29, 2017
    Posts:
    54
    Not sure if you want to do it this way, but you can embed a WebGL Build as an iframe.

    I've built out a website for hosting unity webgl games called https://simmer.io which specializes in embeds (just like embedding a youtube video). It's free BTW

    You upload to the site, copy an embed link and embed a frame in your Wix page

    I haven't made a Wix specific tutorial, but it is very similar to how you embed a game in wordpress as described in this video



    I can't find the URL right now, but I know for sure, that somebody successfully embedded a SIMMER game in their wix site.
     
  5. Dragantium

    Dragantium

    Joined:
    Feb 14, 2015
    Posts:
    34
    Es un gran sitio, una gran herramienta que me ha ayudado mucho. Gracias como desarrollador independiente por crearlo.