I’ll preface this by saying that this project works flawlessly both in-editor and as a standalone. However, once I run a WebGL build (linear color space, so WebGL 2.0), I get a series of errors that prevent the game from even loading.
After hours of rebuilding the WebGL build and watching console output like a hawk, I’ve finally discovered the specific lines of code that are throwing the error (this is the very first function that runs after the splash screens) - see below for details.
private IEnumerator LoadLevelWithAwaitAsync(string levelName)
{
sceneLoaded = false;
loadBar.value = 0;
cardAnimator.StopPlayback();
animator.SetTrigger("FadeOut");
// Error throws at this yield, if I comment it out...
yield return new WaitForSeconds(1.0f);
AsyncOperation op = SceneManager.LoadSceneAsync(levelName);
while (!op.isDone)
{
loadBar.value = Mathf.Clamp01(op.progress / 0.9f);
// Then the error throws at THIS yield ... sensing a pattern?
yield return null;
}
while(!sceneLoaded)
{
yield return null;
}
ResetParameters();
animator.SetTrigger("FadeIn");
yield return new WaitForSeconds(1.0f);
cardAnimator.StartPlayback();
nonSettingsRemover.SetSceneName(levelName);
}
The actual error that’s being thrown is as follows:
The alert text that pops up is as follows
I’m not sure this part is relevant, since I just assume this is saying the unity script is unable to progress, but immediately after closing the alert box, I get