Sometimes you want to share your terrain that you created with another Unity developer, for example when working in a team. To export an unity terrain over in another project in the exact correct location and with everything unnecessary removed, you can follow these instructions:
- Select the scene that contains your terrain in the Asset hierarchy and press Ctrl + D to create a duplicate.
- Give the copy a speaking name, e.g. "Terrain Export".
- Open the duplicated scene.
- Get rid off everything that is not necessary for your recipient. You can remove everything related to Gaia and your core terrain should still look the exact same. This article in the knowledge base gives an overview which Gaia Elements in the scene are responsible for what and which can be deleted. Most of the Gaia Environment Settings with Skies, Water, Player, Post-Processing etc. require Gaia being present in the project and can therefore not be shared that easily. If you want to keep those elements for your final project you can still export the core terrain for your colleagues, and then do the final build / publication from the computer where Gaia is installed.
Note that if any script on a GameObject has a hard reference to another asset, that asset will later be included in the export. If, let's say, a palm tree asset has a script that spawns coconuts around it that fall down, those coconut assets will be included if there is a direct reference on the coconut spawning script.
- After you wiped the scene clean of everything unwanted, save the scene and export it as a package with "include dependencies" checked.
- On the recipient's computer, import the package.
- Open the target scene where you want the terrain to be imported in.
- Locate the "Terrain Export" scene in the Asset hierarchy, right click it and select "Open Scene Additive".
- The "Terrain Export" scene should open additionally to the target scene that is already opened, and you can copy the terrain and everything else over via drag and drop.
- After that you can save the target scene and delete the empty "Terrain Export" scene.
This procedure should result in a precise export of the terrain and additional GameObjects placed on it in the exact correct position without any additional unwanted assets being imported. It might sound a bit complicated first, but once you try it you will find only step 4 will be really time consuming.