FAQ
This error occurs when using an older version of Unity that is not supported. The installer requires Unity 2020.3 or newer.
In ’newer’ versions of Unity, the ability to switch the WebGL linker target has been removed. This means that when updating asm.js projects (from an older version from Unity) you are not able to switch to WebAssembly.
Below is a script that can be placed in an Editor folder in your project that will display a prompt that allows you to switch.
using UnityEditor;
using UnityEngine;
public static class WebGLUpdater
{
[InitializeOnLoadMethod]
private static void Execute()
{
if (PlayerSettings.WebGL.linkerTarget != WebGLLinkerTarget.Asm || Ignore)
{
return;
}
const string title = "WebGL Updater";
var message = $"The WebGL linker target for this project is currently set to {PlayerSettings.WebGL.linkerTarget}.\n\nWould you like to switch to {WebGLLinkerTarget.Wasm} now?";
if (EditorUtility.DisplayDialog(title, message, "Yes", "Ignore"))
{
PlayerSettings.WebGL.linkerTarget = WebGLLinkerTarget.Wasm;
Debug.LogFormat("WebGL Linker Target is set to: {0}", PlayerSettings.WebGL.linkerTarget);
}
else
{
Ignore = true;
}
}
private static bool Ignore
{
get => SessionState.GetBool($"{nameof(WebGLUpdater)}.{nameof(Ignore)}", false);
set => SessionState.SetBool($"{nameof(WebGLUpdater)}.{nameof(Ignore)}", value);
}
}