2

I did something bad, i removed a bunch of stuff and added a lot more. i have no idea what i really did and i can't revert the change. the project is too big to just look around at random. now i get nullreferenceexception:

NullReferenceException: Object reference not set to an instance of an object UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at <780782bc035845f9909cebbd4c983ae3>:0) UnityEditor.PropertyEditor.RebuildContentsContainers () (at <780782bc035845f9909cebbd4c983ae3>:0) UnityEditor.InspectorWindow.RedrawFromNative () (at <780782bc035845f9909cebbd4c983ae3>:0)

How do i find out what 780782bc035845f9909cebbd4c983ae3 is or where 'something' is missing?

nope nope
  • 21
  • 1
  • Does this answer your question? [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – BugFinder Jul 08 '22 at 12:54
  • @bugFinder the question understands what a null referance exception is, that's not what's being asked – Jay Jul 08 '22 at 13:11

2 Answers2

1

I had been experiencing this for a while. It was apparently because I had multiple Inspector windows open. I closed the extra one and restarted Unity. That made the error go away for me.

AShbeeb
  • 36
  • 3
0

The short answer about that error is that it's an error that announce you that one of the GUI element of the editor is unable to access whatever it tries to access.

This is not your fault, but more like a tiny synchronization problem between the editor and its references. That error can happen if you got some hidden/unfocused active menu (like, often, being a 2nd inspector) that refers (meaning would display if active/focused) an old references that has some changes.

This kind of error can easily be fixed by saving (if not already done) your editor layout (top-right dropdown button called "Layout", then "save Layout"), then (in the same drop down) "Reset Layout" and then you can load the layout back in. This will force the editor to reset all active menu with a selection, hence fixes whatever is wrongly selected a NULL object.

This error can happen if, for example, you have 2 inspectors in your editor (quite useful if you want to keep 1 object selected to access it scripts or components and select stuff from the Project or Hierarchy menus). Sometimes, Unity fails to clean its selection cache when it should be cleaned.

Then, when you press "Play", the editor is attempting to store and cache all current inspector/object/component states (so that it can return to that state once Play is stopped), but it fails to access (and cache) whatever is still wrongly cached to a certain menu (like a 2nd inspector) so it returns that error telling you that some editor property are returning a NullReferenceException (meaning that it doesn't exist).

user3345048
  • 361
  • 3
  • 3