BUG? State Inspector Helper Game Objects Appearing

Badamb

New member
Ultimate Character Controller Version 2.3.1
Unity Version 2021.1.1f1

Whenever I click on one of my character assets I get seven New Game Objects appearing in the hierarchy. They all have the State Inspector Helper script. They then keep spawning if I keep the asset selected.

Sorry it's a bit vague but this other thread explains it well:

 

Justin

Administrator
Staff member
I haven't been able to reproduce it from that thread - if you can let me know how to reproduce from a fresh project that would be great.
 

Badamb

New member
Hi Justin,

I started a fresh project and imported the same character asset. I noticed it only happens if the character is selected and if the Attribute Manager Script is expanded in the inspector.

I noticed with the fresh project that I was getting the following error each time the New Game Object was spawned:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Editor.Inspectors.Traits.AttributeManagerInspector.OnAttributeStateListDraw (UnityEngine.Rect rect, System.Int32 index, System.Boolean isActive, System.Boolean isFocused) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Traits/AttributeManagerInspector.cs:268)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:995)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:774)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:758)
Opsive.Shared.Editor.Inspectors.StateSystem.StateInspector.DrawStates (UnityEditorInternal.ReorderableList reorderableList, UnityEditor.SerializedObject serializedObject, UnityEditor.SerializedProperty states, System.String selectedIndexKey, UnityEditorInternal.ReorderableList+ElementCallbackDelegate drawCallback, UnityEditorInternal.ReorderableList+AddCallbackDelegate addCallback, UnityEditorInternal.ReorderableList+ReorderCallbackDelegate reorderCallback, UnityEditorInternal.ReorderableList+RemoveCallbackDelegate removeCallback) (at Assets/Opsive/Shared/Editor/Inspectors/StateSystem/StateInspector.cs:84)
Opsive.UltimateCharacterController.Editor.Inspectors.Traits.AttributeManagerInspector.DrawSelectedAttribute (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Traits/AttributeManagerInspector.cs:243)
Opsive.UltimateCharacterController.Editor.Inspectors.Utility.ReorderableListSerializationHelper.DrawReorderableList (UnityEditorInternal.ReorderableList& reorderableList, Opsive.Shared.Editor.Inspectors.InspectorBase inspector, System.Array drawnObject, System.String serializedData, UnityEditorInternal.ReorderableList+HeaderCallbackDelegate drawHeaderCallback, UnityEditorInternal.ReorderableList+ElementCallbackDelegate drawElementCallback, UnityEditorInternal.ReorderableList+ReorderCallbackDelegate reorderCallback, UnityEditorInternal.ReorderableList+AddCallbackDelegate addCallback, UnityEditorInternal.ReorderableList+RemoveCallbackDelegate removeCallback, UnityEditorInternal.ReorderableList+SelectCallbackDelegate selectCallback, System.Action`1[T] drawSelectedElementCallback, System.String key, System.Boolean requireOne, System.Boolean indentList) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Utility/ReorderableListSerializationHelper.cs:91)
Opsive.UltimateCharacterController.Editor.Inspectors.Traits.AttributeManagerInspector.OnInspectorGUI () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Traits/AttributeManagerInspector.cs:52)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:617)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)


Hope that's of some use!
 

Justin

Administrator
Staff member
That error is likely the reason for the empty GameObjects. Can you send the scene to support@opsive.com that is causing the error? I created a fresh scene in a new project and after creating the character I didn't get that error.
 
Top