When you create a var
var test : GameObject; ← then got to the inspector and try to click the little circle Unity crashes.
and also i always have this error
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ObjectSelector.OnDisable () (at C:/BuildAgent/work/6bc5f79e0a4296d6/Editor/Mono/ObjectSelector.cs:138)
and when i click it the object select circle
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ObjectSelector.Show(UnityEngine.Object obj, System.type requiredType, UnityEditor.SerializedProperty property)
but i cannot read the rest of it. It freezes and the report bug screen comes up. Tried reinstalling but did not change anything. It started when i tried to select a object and now its broke!!
Any help is greatly appriciated. One last thing I’ve tried to send the bug report twice but failed both times.
that was just a example it doesn’t matter what variable i try or what type i plugin it crashes every time. I have not had any problems with crashing so this just starting out of thin air doesn’t make sense. So i am going to fully uninstall clear everything out and reinstall and pray!!
Try reverting your window layouts back to factory default. I had the EXACT same issue and it was because I re-loaded my window layout that was saved in a previous version of Unity.
Upon reverting back to factory defaults, everything worked like normal. Unity was looking for a window that didn’t exist. I guess maybe they changed the name or location of the select dialog between versions 3.1 and 3.2 or higher?
I now have pretty much the same problem, but reverting the Unity GUI layout to factory settings does not help.
I simply declared a variable in a CS script:
public Texture cCPortrait;
and tried in the inspector to assign a texture to it. The selector opens, I click on a texture and a second later (depending on time or maybe mouse movement over another texture) the selector window goes blank and I get a whole bunch of those in the console:
NullReferenceException: Object reference not set to an instance of an object UnityEditor.ObjectSelector.OnGUI () (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/ObjectSelector.cs:590) System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/GUI/DockArea.cs:228) UnityEditor.HostView.Invoke (System.String methodName) (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/GUI/DockArea.cs:221) UnityEditor.HostView.OnGUI () (at C:/BuildAgent/work/b0bcff80449a48aa/Editor/Mono/GUI/DockArea.cs:121)
First I tried this in my current project in Unity 3.5 under Win7.
I reverted the Unity Editor Layout as mentioned here, but that did not help.
I tried to just restart Unity, but this did not help.
I created a new project with just one script that defines the variable, same problem there (so it doesn´t have anything to do with my project).
I started up another PC with Win XP and Unity 3.4 on it, created a new project as before, but the same problem there.
I reverted the layout several times, restarted unity several times, but the object selector kept crashing.
I even made all files in the project folder writeable to be certain, but no success.
Could anybody please try this out and let me know if that works for you? I attached a zip-file of the project (for unity3.4) to make it simple.
Okay problem solved. You can´t assign the objects (texture in this case) to a script in the project view, but have to assing it to an object in the scene (hierarchy view) which has the script assigned to it.
Oh boy, this drove me crazy for more then a day. Well I´m an artist, not a programmer, that´s my excuse