- Home /
Big Prefabs Size
Hi community, I got a game in which I got 100 Levels. I was instantiating the levels with a script which had the references of the prefabs that were placed in a folder lets say Assets --> _Prefabs. But as they were in reference in the script the scene was taking so much time to load. So I added all the prefabs in the resources folder and instead of taking prefabs from the script I used the Resources.Load() function in order to instantiate new levels. Now, although the performance problem is resolved now I am facing huge storage issues in my game due to these prefabs. The 100 prefabs are taking almost 450mb of storage inside build. I checked it using BuildReport tool. I've tried disabling the prefabs content in the editor which could be enabled on runtime but the size remained the same. Each level prefab contains other prefabs as well like coins prefabs, hurdles prefabs etc. I was thinking maybe there are prefabs inside the level prefab so that's why it is taking this huge storage but after unpacking those prefabs(coins, hurdles, enemies) completely I still couldn't gain any storage on my end and the size in the build remained the same. Any help on reducing the size would be really helpful. Im working on an iOS game.
Answer by ImagineUnity · Mar 23 at 09:59 AM
I'm gonna assume the reason for that is because the Prefab is being run throughout all scenes, therefore taking up more space, Especially with a bunch of gameObjects, the reason it doesn't take as much when you unpack it is because it's no longer apart of the prefab and it's own GameObject, I would look for a better approach for the Prefabs.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
unity build eating storage,where the half of the storage is filled in unity build? 0 Answers
Project size 1 Answer
Should build of a 2D project using the new 2D features in 4.3 be smaller than a 3D project? 1 Answer
Texture size problem: 650 pictures (jpg 924x594) makes my app 850mb larger!?!? How to reduce? 2 Answers