I am getting this error Its not a normal NullReferenceException: Object reference not set to an instance of an object error its about my game files Its cant block my porjeckts I can switch play but I am getting
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.ClearPreviewCache () (at <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEditor.GameObjectInspector.ReloadPreviewInstances () (at <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEditor.GameObjectInspector.OnForceReloadInspector () (at <1e441e8684a14fe4b8f8a926d91afc3a>:0)
UnityEditor.Tilemaps.GridPaintPaletteClipboard:OnDisable() (at C:/Program Files/Unity/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:347)
Looks like some custom inspector issue. Try reset layouts in your editor, which will close stray inspector windows that may no longer be valid because a script went away.
If it is in an inspector you wrote or that you control, the answer is always the same… ALWAYS. It is the single most common error ever. Don’t waste your life on this problem. Instead, learn how to fix it fast… it’s EASY!!
Some notes on how to fix a NullReferenceException error in Unity3D
Expect to see this error a LOT. It’s easily the most common thing to do when working. Learn how to fix it rapidly. It’s easy. See the above link for more tips.
This is the kind of mindset and thinking process you need to bring to this problem:
Note the “PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:347)”
…so it might be some internal bug or edge case with the tilemap editor.
I had the exact same exception popping all the time and it definitely has something to do with the Tile Palette.
I had it open as a tab and just closing the palette stopped the exception.