What exactly does Unity load into system memory upon loading a scene?

Does Unity only load objects that are active? Does Unity pre-load prefabs that are referenced in scripts attached to active objects? I couldn’t find the answer to this in the documentation.

I’m asking this because I’m making a game with a hub world where the levels are instanced as prefabs. I’m not putting the different levels on different scenes because I don’t want the player to wait for a loading screen upon death, and because I find it easier to do it all in one scene. I don’t see any stuttering or abnormally high ram utilization on my end (my assets are pretty light), but I’m afraid that this method will cause weaker hardware to perform badly. Anyway, I want to know if I’ll have to manually load the levels into memory before instantiating them, or if Unity already does this management in the background.

Sorry if this is a dumb question, and thanks in advance!

Every Go and Component in scene and every referenced asset from any script in scene (no matter active or inactive) will be loaded into memory along with scene itself.

2 Likes

Thank you, Jes! So if there’s any weird long pause or stutter in my Unity application during runtime, it’s probably because of issues with my code rather than an asset streaming issue, right? I’m having one such issue, and I thought it was because I wasn’t loading things manually. I guess this isn’t the problem then.

Yes
But may be this is shader prealoding :slight_smile: