We have one outside scene, and we want to make a couple of indoor scenes. We want all the terrain of the outside, the trees, etc, visible through the windows. For this we need the terrains in each scene to be separated to scene-specific changes can be made. All the trees have been placed, so placing more trees is not a concern.
Every method I've tried in duplicating terrain has failed. Duplicating the terrain in the hierarchy does not work as the terrains are still connected. Duplicating the terrain assets (TerrainData) also does not work either. I have also tried making a new terrain and replacing its terrain data with a duplicated terrain data, but everything remains invisible. What is the correct way to duplicate a terrain so that changes to one do not affect the others?
Duplicating the terrain assets (TerrainData) also does not work either.
Duplicating the terrain asset definitely does work.
Edit: I should note that you should drag the duplicated terrain asset into the scene in order to create the terrain duplicate. If you duplicate the terrain that's already in the scene and try setting the terrain data asset via the inspector, it seems to be bugged and won't establish the link correctly.
Since there are still people having trouble with the Terrain script, here are a few facts:
The TerrainData asset that is created when you create a new terrain in the scene contains all information that will make up the terrain.
The Terrain script that is attached to a GameObject just has a “hidden” link to that TerrainData asset.
This link isn’t ment to be changed once a terrain has been created. However it’s possible to change it, more details at the end.
When you duplicate the TerrainData asset you definitely have a seperate asset. The new asset as no connection to the old one.
Do not duplicate the old gameobject that contains the Terrain script. The hidden link inside the Terrain script will still point to the old asset. So both Terrain instances would use the same TerrainData asset.
To actually create a new Terrain object in the scene you have to drag the new TerrainData asset into the scene / hierarchy view. This will create a new GameObject with a new Terrain script that has that new TerrainData asset linked internally. It also creates a TerrainCollider with the new asset linked.
Finally here’s how you can change the linked TerrainData asset after the Terrain object has been created:
So just imagine you have duplicated the TerrainData asset as well as the Terrain GameObject in the scene. As said before that new gameobject will still use the original TerrainData asset. The TerrainCollider component on the same gameobject actually has an object field where you can select / set the TerrainData asset that it should use. Unfortunately the custom editor for the Terrain script is lacking such an object field.
However you can change it anyways by switching the Inspector window into debug mode. Just open the window menu of the Inspector by clicking on the button at the at the top right of the inspector. Select “Debug” to switch into debug mode.
When the inspector is in debug mode, no custom editor or propertydrawer will be used, not even the built-in that comes with Unity. The inspector now simply shows all data that has been serialized for the inspected objects. The Terrain script has a field called “Terrain Data”. There you can drag&drop your new TerrainData asset. Once you have linked the asset you should switch the Inspector back into “Normal” mode.
Don’t forget to also change the TerrainCollider so it also uses the new asset.
Once you’ve done this you can edit both terrains independently from each other.
As far as i know this has been the case from the very beginning. Nothing has changed since then. I use Unity since version 2.6 and back in 2009 / 2010 it was already that way.
I also found another solution (the last two answers weren’t working for me). Instead of duplicating my terrain asset in Unity, these are the steps I took.
Close Unity
Go to the folder that holds your Terrain.asset
Duplicate that file (so the .meta file isn’t created)
Paste that file where you want it to be
Open Unity (now it’ll create a .meta file that is specific to the new terrain)
Drag your .asset into your scene and VOILA!
This worked for me as a workaround. There’s still some where connection going on (blue paintbrush highlight still shows on both terrain, but doesn’t paint on both terrain. Materials on both terrain paintbrush tab is also connected) but it works.