Search Issue Tracker
Fixed in 2019.3.X
Votes
1
Found in
2019.2.0b10
2019.3.0a5
2019.3.0a11
Issue ID
1171902
Regression
Yes
[Terrain] Throws NullReference Exception on adding Terrain component to GO when paint texture is selected
Throws NullReference Exception on adding Terrain component to GO when paint texture is selected under paint terrain.
Steps to repro:
1. Create a new project.
2. Hierarchy > Right-click > Create Empty
3. Add Component > Terrain Collider > Terrain
4. Assign Terrain data and terrain asset
5. Hierarchy > GameObject > Terrain > Paint Terrain > Paint Texture
Actual Result:
NullReference exceptions are thrown.
Expected Result:
No exceptions are thrown in the console.
Reproducible in:
2019.3.0a11, 2019.3.0a5, 2019.2.0f1, 2019.2.0b10
Working Fine in:
2019.3.0a4, 2019.2.0b9, 2019.1.0f2
Environment:
Windows and Mac.
Stack Trace:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:105)
UnityEditor.TerrainInspector.ShowPaint () (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1499)
UnityEditor.TerrainInspector.OnInspectorGUI () (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:2000)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass53_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:494)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Keywords on Material Variants aren't automatically saved when changed on original Material through Shader Graph
- Light Probes get baked when calling LightProbes.Tetrahedralize
- Shadows flicker and cause visual artifacts when modifying a GameObject's bounds using Swizzle (Y Mask) and Sine Time nodes
- [WebGL] Frame rate drops by 5-20 fps when moving cursor or touch input in the Player
- Light bleeds when using box shaped spotlight with specific Emission Range values
rvndudz77
Oct 12, 2023 19:39
Once you created a palatte, you should save it before move into another panel or interface. That is the fix!
newlife
Jan 13, 2021 01:39
A similar bug is present in Unity 2019.4.17f1
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.TerrainAPI.PaintTextureTool.UpdateLayerPalette (UnityEngine.Terrain terrain) (at Library/PackageCache/com.unity.terrain-tools@3.0.2-preview.3/Editor/TerrainTools/PaintTextureTool.cs:754)
UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at Library/PackageCache/com.unity.terrain-tools@3.0.2-preview.3/Editor/TerrainTools/PaintTextureTool.cs:344)
UnityEditor.TerrainInspector.ShowPaint () (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEditor.TerrainInspector.OnInspectorGUI () (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <2f1c602eae0d45c293fff3e3aef759fa>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)