Schnurbusch Games

PortraitFit

Ship your portrait Unity game on the web without distortion.

PortraitFit cover art

Your Unity game is portrait, built for phones at 9:16, but Unity's default WebGL page assumes landscape. On the web the result is a game that is squeezed, distorted or tiny. PortraitFit fixes that with one file.

What it does

Setup in three steps

Configuration

Everything sits in two clearly marked config blocks at the top of index.html: aspect ratio, which defaults to 9:16 but accepts any ratio, fill behavior on phones, and the colors for background, bars and loading screen. Plain HTML, CSS and JavaScript, no build tools and no dependencies.

Battle tested

This template ships with my own game Famechaser, on desktop and mobile.

Requirements

Built and tested with Unity 6. The template mechanism itself works the same way from Unity 2020 onward. It works anywhere your index.html is served directly, on your own site or on most portals. Portals that wrap games in their own player ignore custom templates entirely, which is a platform limitation rather than a PortraitFit one.

Where to get it

All tools