How to make multiple terrains from a prefab

I need to make a terrain from several terrains, of course I made a prefab of it, but the problem is in the data, the fact is that the terraindata is obtained for all one, so if I start editing one terrain, the rest will be affected, I try to copy these dates and paste them separately as separate files, but everything is the same.
How to do it right?

There isn’t AFAIK an easy way to do this.

The reason is that Terrain data isn’t stored in a prefab.

It’s always stored in a separate data object, the file usually called New Terrain.asset when you make a new terrain.

You can make a prefab out of everything ELSE that you stick on your terrain. To do that, just make a parent object and put all stuff under that, then make a prefab out of it.

You can also clone your terrain file (the .asset file above) and then drag it into your scene and edit it, and it will be a different terrain.

I copied the .asset file and renamed it and as a result I had several such files, then I inserted each separate one into each prefab, so each prefab had a separate file, but anyway, when I edited one area, those others were edited, I suppose, but the data file itself has some kind of binding…

Terrain newTerrain = newTerrainObject.GetComponent<Terrain>();
TerrainData newTerrainData = Instantiate(newTerrain.terrainData);
newTerrain.terrainData = newTerrainData;
// or
terrain.terrainData = new TerrainData();

I tried to just create a new component during the game, but then it turns out that all this vertex data is kept in RAM, or what?

I want to note that my vertex data is stored in another file, I only need to enter my data into the terrain data to visualize the result…

By the way - I don’t need a terrain collider, just like I said, I have the vertex data in another file, so can I somehow set the vertices without TerrainData?
although I know it’s unlikely…

Glad you wrote that. I think you’re on the wrong track. Or perhaps I am?

  • If you speak of the old Unity terrains, those don’t have vertices, they have heights

  • if you speak of the new terrains, everything I wrote above I am not sure if it applies anymore.

There ARE scripts that can “clone terrain data fully,” for whatever that means. But since the new terrain system is an upgrade and more-recent, I’m not sure how you would know that a terrain is fully cloned without inspection.

Aaaaaaaaanyway… finally I have a procgen package called MakeGeo with terrain stuff in it.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

And there’s this too:

https://www.youtube.com/watch?v=FykNmJ3NIpI

I was talking about heights, I made a mistake with the wording, but what does the new terrain mean?
I’m using the latest version unity and I’m using the standard terrain, but I understand there is also some new terrain?
I’m already confused…