This error always happens when the game is playing in the editor, and the Scene Hierarchy has a bunch of gameobjects being created/removed and its causing the scrollbar to move around, sometimes when selecting any item in the list… it often generates this error…
Exception: NullReferenceException: Object reference not set to an instance of an object
UnityEditor.TreeView.GetNewSelection (UnityEditor.TreeViewItem clickedItem, Boolean keepMultiSelection, Boolean useShiftAsActionKey) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:1000)
UnityEditor.TreeView.SelectionClick (UnityEditor.TreeViewItem itemClicked, Boolean keepMultiSelection) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:1028)
UnityEditor.TreeView.HandleUnusedMouseEventsForNode (Rect rect, UnityEditor.TreeViewItem item, Boolean firstItem) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:352)
UnityEditor.TreeView.DoItemGUI (UnityEditor.TreeViewItem item, Int32 row, Single rowWidth, Boolean hasFocus) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:444)
UnityEditor.TreeView.IterateVisibleItems (Int32 firstRow, Int32 numVisibleRows, Single rowWidth, Boolean hasFocus) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:568)
UnityEditor.TreeView.OnGUI (Rect rect, Int32 keyboardControlID) (at C:/buildslave/unity/build/Editor/Mono/GUI/TreeView/TreeView.cs:504)
UnityEditor.SceneHierarchyWindow.DoTreeView (Single searchPathHeight) (at C:/buildslave/unity/build/Editor/Mono/SceneHierarchyWindow.cs:585)
UnityEditor.SceneHierarchyWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneHierarchyWindow.cs:399)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
The temp solution seems to be just parent everything and hides its ass so its not expanded and any objects being (re)moved/created inside of it is hidden, then you don’t get anything causing the hierarchy views scrollbar to be moving about expanding etc …when you’re selecting anything in it… its still annoying and sometimes clicking on something doesn’t select it first time.
Also I’m tired of having only one effing Inspector view, should be able to have multiple gameobject views opened up. On the subject this
Should be built into the gui, so I’m not left dealing with useless workflow we have right now… instead 5.4 broke it.
Why I am using 5.4, because 5.3 has even more problems.