user3789296
user3789296

Reputation: 23

Terrain streaming in unity 3d

I am making an open world game and i want to know if there is a way of doing terrain streaming ( loading the terrain into mamory only if the player is close to it ) without using the LoadLevelAdditiveAsync function . i am using free version so this function is not available to me .

Upvotes: 0

Views: 3096

Answers (2)

Joey Quinto
Joey Quinto

Reputation: 367

Don't forget as long as your terrain patches together nicely, you can always Instantiate terrain prefabs at run time.

Depending on how proficient you are at it, you can also procedurally create terrain at run time as well.

Upvotes: 1

Selali Adobor
Selali Adobor

Reputation: 2157

You can do it, and there are different ways to do it. I figure the easiest way to do it (but definitely not the most memory friendly) would be to define your entire level in one scene with multiple small terrains, using the TerrainStitcher tool to deal with seams. Then you could parent all objects under each terrain to a single transform, and use Instantiate to create/destroy them at runtime (in another scene). There are tools that take this approach a bit further, like this one.

But remember that in general big terrains in Unity aren't memory friendly and will reduce your performance. When using an endless terrain, where you don't care about defining the terrain before runtime you can reuse a few terrain objects and simply reposition them, but if you're designing them first, there isn't too much you can do other than lowering terrain settings like Pixel Error, and limiting details and grass.

Upvotes: 0

Related Questions