Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity terrain cannot find terrain layers

Discussion in 'World Building' started by BIGTIMEMASTER, Oct 1, 2019.

  1. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    3,593
    In the terrain inspector window, the layers menu is missing and I get this error:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.Experimental.TerrainAPI.PaintTextureTool.UpdateLayerPalette (UnityEngine.Terrain terrain) (at Library/PackageCache/com.unity.terrain-tools@2.0.2-preview/Editor/TerrainTools/PaintTextureTool.cs:744)
    3. UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at Library/PackageCache/com.unity.terrain-tools@2.0.2-preview/Editor/TerrainTools/PaintTextureTool.cs:339)
    4. UnityEditor.TerrainInspector.ShowPaint () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1433)
    5. UnityEditor.TerrainInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1867)
    6. UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:501)
    7. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    It's an issue with the Terrain Tools preview package. Removing it solves the error. However, reinstalling teh package still makes the error.
     
    Last edited: Oct 1, 2019
  2. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    Can you file a bug report for me and I'll see if I can figure out what's wrong
     
    BIGTIMEMASTER likes this.
  3. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    3,593
    will do. first thign tomorrow morning i send that out. I will need some time to try and reproduce it, but I think i had figured out that it was somethign to do with either amplify shader editor or megasplat being present in the project along with the terrain tools package. But I gotta go back and try to reproduce before I can say for certain.
     
    Last edited: Oct 6, 2019
    wyattt_ likes this.
  4. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    ok, thank you!
     
  5. JulinoleumOne

    JulinoleumOne

    Joined:
    Nov 2, 2016
    Posts:
    13
    Have you been able to reproduce it? I got the same errors in my project when I start a build. The Terrain layers are gone afterward and terrains are not visible in the build
     
    BIGTIMEMASTER likes this.
  6. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    3,593
    Ive been out of town and not able to work in that project. If I remember correctly, it seemed that the reliable way to solve the bug was by removing megasplat from the project.

    If you have the same bug but don't have megasplat in your project... well then I dunno. Lol. But I am just working off memory here.
     
  7. JulinoleumOne

    JulinoleumOne

    Joined:
    Nov 2, 2016
    Posts:
    13
    Had Megasplat before, but removed it when switching to HDRP. So I dont know if there is a remnant somewhere but it didnt fix the problem !
     
  8. rafindio

    rafindio

    Joined:
    Apr 16, 2020
    Posts:
    2
    I'm having the same problem and I added the HDRP recently too.
    Unity 2019.2.21f1
     

    Attached Files:

  9. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    are you getting the same error or a different one?
     
  10. N-8-D-e-v

    N-8-D-e-v

    Joined:
    Apr 14, 2020
    Posts:
    22
    simply restarting unity fixed everything for me, I am using Unity 2020.2f with URP
     
    dkm likes this.
  11. dkm

    dkm

    Joined:
    Sep 9, 2013
    Posts:
    23
    Same here, had the issue with 2020.2f with hdrp. Restarting unity also fixed it.
     
  12. N-8-D-e-v

    N-8-D-e-v

    Joined:
    Apr 14, 2020
    Posts:
    22
    unfortunately I get this error very often, and have to constantly restart when using terrain tools
     
  13. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    heya everyone. which versions of the Terrain Tools packages are you all using?
     
  14. N-8-D-e-v

    N-8-D-e-v

    Joined:
    Apr 14, 2020
    Posts:
    22
    Version 3.0.2-preview.3 - November 09, 2020
     
    wyattt_ likes this.
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,850
    Maybe check this thread. Might be related to when stuff gets purple.
     
    wyattt_ likes this.
  16. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    368
    ok. thanks. i will have a look
     
  17. marketlandaliyan

    marketlandaliyan

    Joined:
    Dec 15, 2020
    Posts:
    6
    same problem :( using unity 2020.2.2f1
     
  18. Middelbo

    Middelbo

    Joined:
    Apr 30, 2013
    Posts:
    9
    Same problem here in: 2020.1.17f1.4949
     
  19. VARtechLLC

    VARtechLLC

    Joined:
    Sep 18, 2017
    Posts:
    8
    Are there any updates for this? I'm having the same issue using Unity 2020.2.f3f1 and Terrain tools 3.0.2 preview3
     
unityunity