Hello everyone! I have a large scene and on devices with small RAM there are crashes.
I decided to split the scene into several small sectors. The question is, how should I load these sectors? I have two options to choose from and I don’t know which one would be more correct.
1st: Make several unity scenes and load/unload scenes with sectors.
2nd: Place sectors in prefabs and at the right moment destroy the root object with one sector and instantiate a new sector prefab.
I like the second option more, but I’m not sure which would be more correct. Thank you.
Have you analyzed these crashes are really due to high memory usage? Be very sure about this (use Memory Profiler) before you change your entire architecture.
Correctness is when it works according to specification.
Both additive scene loading and prefab instantiate/destroy (or pooled) are fine.
None… not yet. Textures are always memory hoarders, first try crunch compressing them. It’s faster and easier with an asset postprocessor. Disable their isReadable property.
Hi. I don’t have any problems with crashes, I get it from people, and therefore I have no way to check. But I see on what devices people report errors and most importantly, they all say that it crashes when loading a new scene. And I know that this scene is very large, so I think I can only think that this is the problem.
Hi. I have all Crunch textures. But I didn’t know about IsReadable, thanks for the tip. I don’t really understand what this flag is for and whether it will break anything for me.
It’s to keep a copy in RAM, as well as VRAM, for editing. Disable it for models as well. You will get errors in console if something tries to modify them, so it’s not difficult to catch. Just exclude those in your postprocessor.
I will definitely do it, you gave me a new experience. Thanks. But about loading new resources, what would you choose, a new additional scene or a prefab?
At the moment I have already deactivated sectors. And they are active only where the player is. Thank you, you have given me invaluable experience that I will apply in the near future.