I am developing a mobile app, and I have a single GameObject with over 440 different textures on it. The game runs fine in the editor, but when I export to a device and attempt to run the game, the game crashes once it reaches the scene with the 440 different textures.
I guessed that Unity didn’t like one object having so many texture son it, so I attempted to solve the problem by dividing the GameObject into two objects which each have 220 textures. That didn’t work; the game still crashed once both were loaded.
I figured that maybe if I had the two objects in two different scenes, it would be okay. I put one 220-texture GameObject in Scene 1, and another 220-texture GameObject in Scene 2, but the game crashed when going from Scene 1 to Scene 2.
So then I wondered if maybe the game would completely unload the object from Scene 1 if there was an intermediary scene. I transitioned from Scene 1 to Scene 1.5 (blank scene) and then to Scene 2, and still got a crash.
It looks like, once I’ve loaded a certain number of textures, the game will simply crash. I don’t know if there’s a specific number that is pissing Unity off, or if I’m simply running out of memory on my device.
Either way, what is the solution to this problem? If I want the user to be able to see 440 different textures, what should I do to prevent Unity from crashing?