hisoka_phaere
New member
Hello, I've found that the View Type list on the Camera Controller and Movement Type list on the Ultimate Character Locomotion scripts very buggy.
To replicate (replication steps are done on prefabs):
I'm guessing there is an issue on the logic of how the custom inspector is drawn. Of course, you can workaround this problem by just creating a brand new camera or character with the correct view/movement type settings but this would be a huge pain if you've already set up a lot of custom scripts on the prefabs, you basically have to set them up again.
Forgot to mention that this on the latest LTS version: Unity 2021.3.2f1
To replicate (replication steps are done on prefabs):
- Create a camera with both perspectives (e.g. First Person Combat and Third Person Adventure)
- Create a character with both perspectives (e.g. First Person Combat and Third Person Adventure)
- Decide to change Third Person Adventure to Third Person Combat in the Camera Controller. First Bug: Click on the plus icon and the bug should show. The newly added view type is not visible on the list but somehow it is added in the background.
- Second Bug: Try to workaround the problem by clicking on another GameObject and then back to the Camera Controller (to reset the inspector and redraw the fields). You now notice that there are 3 view types, this includes the Third Person Combat you just added. Press the minus icon and delete the Third Person Adventure view type. This now breaks the inspector and error on the console shows:
[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]IndexOutOfRangeException: Index was outside the bounds of the array.[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.GetElementHeight (System.Int32 index) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:681)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.GetClampedDragPosition (UnityEngine.Rect listRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:1337)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.CalculateRowIndex (UnityEngine.Rect listRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:1342)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.DoDraggingAndSelection (UnityEngine.Rect listRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:1244)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:980)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:745)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at /home/bokken/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:729)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]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, System.Boolean useSerializedData) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Utility/ReorderableListSerializationHelper.cs:94)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]Opsive.UltimateCharacterController.Editor.Inspectors.Camera.CameraControllerInspector.<GetDrawCallback>b__13_0 () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Camera/CameraControllerInspector.cs:150)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]Opsive.Shared.Editor.Inspectors.StateSystem.StateBehaviorInspector.OnInspectorGUI () (at Assets/Opsive/Shared/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:92)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /home/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Editor/Inspector/InspectorElement.cs:636)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /home/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)[/INDENT][/INDENT][/INDENT][/INDENT]
[INDENT=2][INDENT=2][INDENT=2][INDENT=2]
- Now change Movement Type on the Ultimate Character Locomotion from Third Person Adventure to Third Person Combat. Click the plus icon to add a new Movement Type. Click the Third Person Adventure Movement Type and press the minus icon to delete it from the list. Third Bug: Notice the Third Person Movement Type automatically changes to Combat. Press play and change to third person perspective and an error will show that Ultimate Character Locomotion cannot find the Adventure Movement Type. Inspect the prefab as text in your IDE and search for "Adventure". You'll find that the value for Third Person Movement Type is still set to the old value of Third Person Adventure. Even though the inspector automatically shows Combat, the prefab is actually not updated with the value.
I'm guessing there is an issue on the logic of how the custom inspector is drawn. Of course, you can workaround this problem by just creating a brand new camera or character with the correct view/movement type settings but this would be a huge pain if you've already set up a lot of custom scripts on the prefabs, you basically have to set them up again.
Forgot to mention that this on the latest LTS version: Unity 2021.3.2f1
Last edited: