Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

I have a problem with Terrain.

Discussion in 'Editor & General Support' started by wisemeth, Feb 5, 2022.

  1. wisemeth

    wisemeth

    Joined:
    Dec 6, 2020
    Posts:
    8
    I have two scene. Also, I use same terrain (I coppied) in two different scenes. I do some changes on terrain in Scene-1 but when I open Scene-2, I see that same changes happened on terrain in Scene-2.
    For example, I want to delete some trees in Scene-2 but when I did this, trees diseppar also in Scene-1.

    How can I fix this problem?
    Thanks.
     
  2. Doomchecker

    Doomchecker

    Joined:
    Apr 5, 2021
    Posts:
    105
    You have to copy the terrain data in the project folder and use one terrain data for each to have them unique.
     
    wisemeth likes this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,779
    Additive scene loading is one possible solution:

    https://forum.unity.com/threads/right-way-for-performance-divide-scene.1023673/#post-6630961
    https://forum.unity.com/threads/right-way-for-performance-divide-scene.1023673/#post-6754330

    https://forum.unity.com/threads/problem-with-canvas-ui-prefabs.1039075/#post-6726169

    A multi-scene loader thingy:

    https://pastebin.com/Vecczt5Q

    My typical Scene Loader:

    https://gist.github.com/kurtdekker/862da3bc22ee13aff61a7606ece6fdd3

    Other notes on additive scene loading:

    https://forum.unity.com/threads/removing-duplicates-on-load-scene.956568/#post-6233406

    Timing of scene loading:

    https://forum.unity.com/threads/fun...ject-in-the-second-scene.993141/#post-6449718

    Also, if something exists only in one scene, DO NOT MAKE A PREFAB out of it. It's a waste of time and needlessly splits your work between two files, the prefab and the scene, leading to many possible errors and edge cases.

    Two similar examples of checking if everything is ready to go:

    https://forum.unity.com/threads/daily-events-and-content-changes.1108202/#post-7143713

    https://forum.unity.com/threads/uni...on-before-other-scripts.1153739/#post-7401794
     
  4. wisemeth

    wisemeth

    Joined:
    Dec 6, 2020
    Posts:
    8
    I coppied the terrain into another folder and I used them seperately but there is still same problem. I adjust one terrain, changes happen in both of file.
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,779
    Terrain data is stored in a TerrainData asset on disk.

    This is different from the data stored in the scene.

    TerrainData is NEVER included in the scene.

    It is merely referenced by Components within the scene, both by the Terrain and by the TerrainCollider Components.

    To have two scenes with different TerrainData, you need to clone the TerrainData itself (which is a file on disk... create a new scene and add a Terrain object to it and you will see a new file created at your project root... that's what I'm talking about), AND then drag that TerrainData into the second scene.
     
  6. wisemeth

    wisemeth

    Joined:
    Dec 6, 2020
    Posts:
    8
    [/url][/IMG]
    https://www.hizliresim.com/2rnzqd9

    It gives error when I try to use different TerrainData.
     
  7. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,779
    You need to change both the Terrain's TerrainData as well as the TerrainCollider's TerrainData.

    Since the TerrainData field is (unhelpfully) not exposed in the Terrain Component's inspector window (this is a serious shortcoming of Unity's Terrain editor window), I believe the only way to do this may be ONE (1) of the following ways:

    - make a new blank scene, drag the duplicated TerrainData into that new scene, then move the actual GameObject with the new Terrain (referencing this cloned TerrainData) over to your main working scene (open two scenes at once in the hierarchy).

    OR:

    - hand-edit the scene or prefab file in a text editor and change out the GUID... this is how I do it, but it is only for ultra-power users... be careful! Use source control or rock-solid backups or you may wreck your project. You have been warned.
     
  8. wisemeth

    wisemeth

    Joined:
    Dec 6, 2020
    Posts:
    8
    It's not working. As if two separate file communicate each other.