(URGENT!!!!!!!!!) WebGL out of memory no matter how much I allocate. [C#]

Hey all! (mildly panicking)


I entered a game development competition last night, only to find out that my game wasn’t working at all. Whenever a certain section of code was being run, the player would say “Out of memory!” I increased the memory allocation from the default 256 all the way up to 2048, and it still would not work. Any other values didn’t work at all.


“Bad initial memory size”
~ Unity WebGL player, 2019


I did some Debug.Loging and found that the code never makes it past this section:

string lwag = "";
for (int i = 0; i < 18;)
{
    for (int j = 0; j < 3;)
    {
        lwag = lwag + levelsWithAllGems[i, j].ToString() + ".";
    }
}
lwag = lwag.Substring(0, 107);
PlayerPrefs.SetString("LevelsWithAllGems", lwag);

Basically, I have an array int[18,3] that I am trying to convert into a string, remove the last period, and set it to PlayerPrefs for a later date. However, it’s just not working!

Please help as judging is underway and I should probably finish this before then.

you are never increasing i and j value so both fors are infinite loops.