How to change background color?

When building an WebGL app, builds/output.json is created and it has the field

“backgroundColor”: “#222C36

Where do I set this color?

I know how to encode color values, but I want to know where in Unity this color is set so I do not manually have to edit it for each build.

you can override all Module parameters contained in the json file at instantiation-time:

   <script>
      var gameInstance = UnityLoader.instantiate("gameContainer", "Build/awesome_game.json", { Module: { backgroundColor: "#222C36" }});
    </script>

I suggest you create your own template, with the following code:

    <script>
      var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%", { Module: { backgroundColor: "#222C36" }});
    </script>

Makes sense?

Goto: player settingssplash image → activate the “show splash screen” checkbox → change background color here.

Great, thanks :slight_smile: