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
- ScrollView clips content when under an ancestor that has a filter set
- "Retrieving array element that was out of bounds" error thrown when attempting to remove a column from a Multi-Column List View
- Multi-Column List View horizontal scroll resets to left most position when scrolling vertically
- Floating License is lost for concurrent jobs
- Warning "Failed to insert item" is logged when Assigning Project to Organization's Project in the Project Settings
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)