---
updatedAt: 2025-11-11T03:31:03.000Z
agentTools:
  projectIndex: https://beamable2.readme.io/llms.txt
---

# Integrating WebGL

Build your Unity Beamable project to target WebGL [IDEN-WebGL-01]

<HTMLBlock>{`
<style>
  .lucidChart1 { 
    
    /* DO NOT EDIT */
    pointer-events: none; 
    user-select: none; 
    position: relative; 
    background-color:rgba(0, 0, 0, 0);
    width: 100%; 
    border:none;
    
    /* EDIT AS DESIRED */
    min-height: 285px; 
  }
</style>
`}</HTMLBlock>

<HTMLBlock>{`
<style>
  
  /* Column #1 within tables */
  .markdown-body table td:nth-child(1)
  {
    width:250px !important;
    min-width:250px !important;
    max-width:250px !important;
  }
  
  /* Column Last within tables */
  .markdown-body table td:last-child
  {
    width:100% !important;
  }
  
</style>
`}</HTMLBlock>

<HTMLBlock>{`
<style>
  .quote
  {
    margin-top: 40px;
    margin-bottom: 40px;
    margin-left: 20px;
    margin-right: 20px;
    font-style:italic;
    font-size:22px;
  }
</style>
`}</HTMLBlock>

## Overview

The purpose of this guide is for game makers to export a Beamable Unity project to the target of **WebGL**.

## Integration

Beamable integrates with this technology.

![1004](https://files.readme.io/74a541a-webglbanner.png "webglbanner.png")

The <a target="_blank" href="https://get.webgl.org/">WebGL</a> technology is for cross-platform, royalty-free, 3D graphics in a Web browser within an HTML5 canvas element.

**WebGL Benefits**

* Features cross-browser and cross-platform compatibility
* Tight integration with HTML content
* Hardware-accelerated 3D graphics

**WebGL Drawbacks**

* Not every Unity feature works with WebGL. See Unity's <a target="_blank" href="https://docs.unity3d.com/Manual/webgl.html">WebGL docs</a> for more info

## Steps

Follow these steps to get started: This process will export a Beamable Unity project to the target of **WebGL**.

#### Step 1. Create WebGL Build

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Detail
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        1. Set Unity Build Target to WebGL
      </td>

      <td>
        • Unity → File → Build Settings → WebGL

        *Note: Not every Unity feature works with WebGL. See Unity's<a target="_blank" href="https://docs.unity3d.com/Manual/webgl.html">WebGL docs</a> for more info*
      </td>
    </tr>

    <tr>
      <td>
        2. Build
      </td>

      <td>
        <img src="https://files.readme.io/70b98ea-newfie.png" width="400" /><br />
        •  Unity → File → Build And Run<br />
      </td>
    </tr>

    <tr>
      <td>
        3. Any build-time compiler errors?
      </td>

      <td>
        •  Resolve errors<br />
        •  Repeat previous step
      </td>
    </tr>
  </tbody>
</Table>

#### Step 2. Share WebGL Build

There are many solution paths to share the WebGL build. The steps below cover one solution path.

Here are steps to host the files on **Github**. This is quick and useful during development, but not likely appropriate for production.

<Table align={["left","left"]}>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Detail
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        1. Open Unity Project Settings
      </td>

      <td>
        •  Unity → Edit → Project Settings... → Player
      </td>
    </tr>

    <tr>
      <td>
        2. Update Resolution
      </td>

      <td>
        <img src="https://files.readme.io/0cbde17-resolution.png" width="400" /><br />
        •  Set Default Canvas Width as desired<br />
        •  Set Default Canvas Height as desired<br />
      </td>
    </tr>

    <tr>
      <td>
        3. Update Compression
      </td>

      <td>
        <img src="https://files.readme.io/126d893-compression.png" width="400" /><br />
        •  Set Compression Format to `Disabled`<br />
      </td>
    </tr>

    <tr>
      <td>
        4. Build
      </td>

      <td>
        •   See [Step 1. Create WebGL Build](https://beamable2.readme.io/docs/integrating-webgl#step-1-create-webgl-build) above for more info
      </td>
    </tr>

    <tr>
      <td>
        5. Commit all Unity Output to Git
      </td>

      <td>
        <img src="https://files.readme.io/70b98ea-newfie.png" width="400" /><br />
        •  See GitHub's <a target="_blank" href="https://docs.github.com/en/get-started">Getting Started</a> for more info<br />
      </td>
    </tr>

    <tr>
      <td>
        6. Update Git Settings
      </td>

      <td>
        <img src="https://files.readme.io/4b228d6-source-setting2x.png" width="400" /><br />
        •  Git → \{Your Repo} → Settings→ Pages

        *Note: See GitHub's<a target="_blank" href="https://pages.github.com/">Pages Docs</a> for more info*
      </td>
    </tr>

    <tr>
      <td>
        7. Enjoy!
      </td>

      <td>
        •   See [Results](https://beamable2.readme.io/docs/integrating-webgl#results) below
      </td>
    </tr>
  </tbody>
</Table>

## Results

Here is the resulting Unity WebGL output. It is fully interactive and running within the HTML page.

#### As HTML Link

• <a target="_blank" href="https://beamable.github.io/Beamable_SDK_Examples/Builds/WebGL/LeaderboardFlowExample/index.html"><https://beamable.github.io/Beamable\\_SDK\\_Examples/Builds/WebGL/LeaderboardFlowExample/index.html></a>

#### As HTML iFrame

<Embed url="https://beamable.github.io/Beamable_SDK_Examples/Builds/WebGL/LeaderboardFlowExample/index.html" title="Unity WebGL Player | com.Beamable.Examples" favicon="https://beamable.github.io/Beamable_SDK_Examples/Builds/WebGL/LeaderboardFlowExample/TemplateData/favicon.ico" iframe="true" width="450" height="900" provider="beamable.github.io" href="https://beamable.github.io/Beamable_SDK_Examples/Builds/WebGL/LeaderboardFlowExample/index.html" />

## Features

Here is a partial list of Beamable feature pages which demonstrate WebGL embeds.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>

      </th>

      <th>
        Name
      </th>

      <th>
        Detail
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <img src="https://files.readme.io/fed8530-icon_-_Leaderboard_Flow.png" width="30px" />
      </td>

      <td>
        [Leaderboards](https://beamable2.readme.io/docs/leaderboards-feature-overview)
      </td>

      <td>
        Allow player to manage leaderboard
      </td>
    </tr>
  </tbody>
</Table>

## Advanced

This section contains any advanced configuration options and workflows.