Dynamic loading of level areas

Hi!

First of all I should say that I’m brand new to Unity and have only been using it for a couple of days.

Now on to my question:
I am making a top-down game where I would like to be able to move between streets and other outside areas into houses and their different floors. I can’t quite figure out how best to do this. I have a sort of ramp set up inside a house where I would like to load another floor as seamlessly as possible. The ramp has a trigger set up but I don’t know if I should load a new scene that duplicates some of the scene from the previous floor or to somehow draw the new floor on top of the old floor. The latter solution might cause poor performance even though I don’t plan on having too many polygons or fancy lighting.

Also, is Unity good at culling or should I make sure to continuously remove things from the scene that are not in line of sight?

Thanks in advance :slight_smile:

Unity is generally pretty good at culling, but take a look at Unity’s Occlusion Culling if you have Pro: http://docs.unity3d.com/Documentation/Manual/OcclusionCulling.html

As for loading assets like you’re saying, Unity makes that pretty easy, though there are a few options.

Prefabs
Most likely, you’ll want to go the Prefab route. This is when you create an object in the Scene, then drag/drop that entire object and its hierarchy as one object, and drop it into the Project tab. You can now easily use the Instantiate command to create copies of that object in the scene.

Asynchronous Level Loading
This is a Pro only feature. If you have something super complex that you don’t want to make into a prefab for whatever reason, you could also use the LoadLevelAdditiveAsync function: http://docs.unity3d.com/Documentation/ScriptReference/Application.LoadLevelAdditiveAsync.html, which will load another scene into your current scene.

Hope that helps!

Very thorough reply. I’ll try the prefabs later today.
Thanks Dave!

Not a problem - best of luck!