Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hmm… part of the masking code checks if STM’s gameObject is active in the hierarchy, or else it just gets ignored. Maybe the code is just getting run in the wrong order or something…? And yeah, like you found, an additional Rebuild() call would fix this. An additional call of ApplyMaterials() might work too, but I have that marked as a private method in the current build.

The masking code is called within ApplyMaterials(), which is called almost at the end of Rebuild(), which is called under OnEnable()… So it’s a bit confusing to me why this wouldn’t work right. Does it just happen when enabling/disabling objects in the unity editor, or with code, too? It might have to do with script execution order if it’s in-editor only?