- Home /
Duplicate Terrain?
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?
None of these solutions are working for me!!! Im on Unity 5.2.1 free... In the above from @$$anonymous$$artian Games when i do the step 3. "notice it says "Terrain Asset $$anonymous$$issing," It doesn't... its stays exactly the same---
Surely there must be a way to copy/paste a terrain so you can work on a new one without affecting the old? $$anonymous$$
hi! I deleted my answer now because that worked for a much older version of Unity. Have you tried $$anonymous$$elvin's solution for Unity 5+ ?
Answer by Eric5h5 · Aug 18, 2010 at 10:05 PM
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.
Answer by Bunny83 · Mar 16, 2016 at 05:13 AM
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.
Thanks @Bunny83 This is the only answer that ACTUALLY WOR$$anonymous$$S!!!! And believe me I have read $$anonymous$$ANY, about swapping Splat $$anonymous$$aps, or duplicating game objects... ITS THE DEBUG $$anonymous$$ODE THATS THE THING!!! As the Terrain Data is actually exposed here, I can duplicate the Terrain I want to base my new terrain on, add it to the new Terrain and start tweaking, leaving the original terrain intact.
This was perfect thanks... You got some points from me...!
$$anonymous$$ark
Well, no. Erics answer does say the exact same thing. The usual way is to drag the TerrainData asset into the scene which will create an actual GameObject in the scene. What i said at the bottom was just a way to change an existing terrain to use a different TerrainData object. It's by far easier to just duplicate the TerrainData asset and drag it into the scene, just like Eric said back in 2010. ^^
@bunny83 Argh! NOW I see what @Eric5h5 means... There is some confusion with his ter$$anonymous$$ology, as I wold call the $$anonymous$$AIN Terrain thing that is created by the Create/Terrain menu, the asset- The thing HE means is the Terrain Data Asset...
But I have to say, Im surprised I didn't just try that method... And your way. with DEBUG, was informative and taught me something new too...
This is the correct way using newer versions of unity and seems to be the only way with the newer ones, I was sure it worked another way before as I did it, but now all that seems to work is the terrain data route. This should be up voted more!
It's way easier to work with now then ever so that is good news!
Answer by huynhke · Jul 25, 2014 at 05:29 PM
Hey guys,
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.
-Kelvin
+1, this bug still exists as of Unity 4.6 and duplicating the file manually worked.
Answer by Julian-Glenn · Aug 18, 2010 at 07:43 PM
Does Eric's answer not work?
http://forum.unity3d.com/viewtopic.php?t=60392&view=next&sid=0f4b2b5d55e40e49c6cfc92a420b954c
Your answer
Follow this Question
Related Questions
Duplicating Terrain at run-time 2 Answers
terrain work 2 Answers
Making Duplicate Terrain Unique? 1 Answer
Duplicated Terrain Object and Data STILL affects other terrains 4 Answers