Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Oof, yeah this looks like the whole "multiple materials on a canvas crash Unity" bug again. I tried to fix this in the latest update since it seemed to be fixed on my computer, but I suppose it's not the case? I've been asking on the Unity forums for months how to solve this and never got a reply, so it's hard to tell if this is something wrong w/ Unity, or if I'm setting materials incorrectly.

One user has already contacted me about this, but all I can really do right now is add a toggle to enable/disable multiple materials on UI? I'll be uploading that version soon, but that's not really the best fix. I'm developing on a mac, and don't have access to a PC to test this yet, and I'm not too sure where to begin...

I'm coding blind, but give this a shot:

Around line 2430 or so, you'll see a block of text like this:

c.materialCount = newMats.Length+1;

for(int j=0; j<c.materialCount-1; j++){

c.SetMaterial(newMats[j],j);

}

Try changing it to be like this:

c.materialCount = newMats.Length+2;

for(int j=0; j<newMats.Length; j++){

c.SetMaterial(newMats[j],j);

}

In the previous build, adding that +1 prevented the crash for me, so it's just a guess, but maybe this'll work?