Skip to content

plopcas/custom-unity-webgl-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Custom Unity WebGL Template

This is a custom Unity WebGL template that combines the best features of both the Minimal and PWA templates:

Features

  • No Unity Logo: Like the Minimal template, there's no Unity logo loading screen
  • Proper Fullscreen Scaling: Like the PWA template, it scales correctly in fullscreen mode (perfect for itch.io)

Key Changes from Minimal Template

The main difference is in the CSS styling:

Original Minimal Template

  • Used fixed pixel dimensions: style="width: {{{ WIDTH }}}px; height: {{{ HEIGHT }}}px;"
  • Canvas didn't scale properly in fullscreen mode

This Custom Template

  • Added a container div with: position: fixed; width: 100%; height: 100%;
  • Canvas uses: width: 100%; height: 100%;
  • This makes the game scale properly to fill the screen in fullscreen mode

Installation

  1. Copy this entire folder to your Unity WebGL templates directory: C:\Program Files\Unity\Hub\Editor[VERSION]\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\WebGLTemplates\Base\

  2. Rename the folder to whatever you want (e.g., "MyCustomTemplate")

  3. In Unity, go to Edit > Project Settings > Player > WebGL settings

    • Under "Resolution and Presentation", select your custom template from the dropdown
  4. Build your WebGL project as usual

Files Included

  • index.html - The main template file with fullscreen scaling CSS
  • humbnail.png - Template thumbnail (from Minimal)
  • TemplateData/webmemd-icon.png - Diagnostics icon (from Minimal)

Perfect for itch.io

This template works great with itch.io's fullscreen mode, ensuring your game scales properly to fill the entire screen.

About

A custom Unity WebGL template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages