MissingReferenceException when locking inspector tab
If I lock the inspector on a gameobject with any script attached I get a "MissingReferenceException" whenever I enter or leave play mode. To be clear, the error occurs once when hitting play, and again when stopping play.
If there is no script on the gameobject I do not get any error.
The script does not matter. When I create a new, blank script I still get the error.
I've tried restarting and using different gameobjects.
Here is the error:
MissingReferenceException: The object of type 'someScript' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEditor.GenericInspector.GetOptimizedGUIBlock (Boolean isDirty, Boolean isVisible, UnityEditor.OptimizedGUIBlock& block, System.Single& height) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:19) UnityEditor.InspectorWindow.FlushOptimizedGUIBlock (UnityEditor.Editor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1430) UnityEditor.InspectorWindow.FlushOptimizedGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1420)
Thanks for this! I did not realize that locking the inspector tab would be the cause of the error.
You wouldn't happen to know a fix would you?
Your answer
Follow this Question
Related Questions
Destroying GameObject while in Inspector = MissingReferenceException 0 Answers
How to properly reference a game object 3 Answers
Scrpits component disappears when I enter playmode 0 Answers
Phisic Material 0 Answers