wInevitable
New member
Having trouble adding custom abilities after updating to the latest UCC version.
I have a custom ability "NoMovement" that freezes the Player position. It is quite simple and based off of the video here https://opsive.com/support/document...r-controller/character/abilities/new-ability/.
I have also added the sub-state/etc to the Player Animator. This ability used to work just fine. Now, it will randomly disappear from the list of abilities in the Ultimate Character Locomotion script. This happens in 2 different ways:
1. Re-ordering abilities in the Editor. I add the custom ability to the list and try to drag it higher in the order. The ability is completely dropped from the Character. Disappears into thin air.
2. When I am able to successful re-position the custom ability in the UCL ability list, the ability will sometimes disappear when loading the scene. Note: I am usually able to play the scene just fine, but if I navigate between scenes, the ability will disappear and break the scene when loading the scene that uses the custom ability.
In the first case, I get this error which seems unrelated to the Ability itself, but rather caused by the fact that the custom ability is no longer present in the abilities list:
In the latter case, I get the following error and when I exit Play mode, the ability is no longer in the abilities list in the UCL script.
I am able to replicate #1 in the Demo Scene, but haven't setup cross-scene loading with Demo to test #2.
I have a custom ability "NoMovement" that freezes the Player position. It is quite simple and based off of the video here https://opsive.com/support/document...r-controller/character/abilities/new-ability/.
C#:
using Opsive.UltimateCharacterController.Character.Abilities;
public class NoMovement : Ability {}
I have also added the sub-state/etc to the Player Animator. This ability used to work just fine. Now, it will randomly disappear from the list of abilities in the Ultimate Character Locomotion script. This happens in 2 different ways:
1. Re-ordering abilities in the Editor. I add the custom ability to the list and try to drag it higher in the order. The ability is completely dropped from the Character. Disappears into thin air.
2. When I am able to successful re-position the custom ability in the UCL ability list, the ability will sometimes disappear when loading the scene. Note: I am usually able to play the scene just fine, but if I navigate between scenes, the ability will disappear and break the scene when loading the scene that uses the custom ability.
In the first case, I get this error which seems unrelated to the Ability itself, but rather caused by the fact that the custom ability is no longer present in the abilities list:
C#:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Editor.Inspectors.Character.UltimateCharacterLocomotionInspector.OnAbilityListReorder (UnityEditorInternal.ReorderableList list) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Character/UltimateCharacterLocomotionInspector.cs:610)
UnityEditorInternal.ReorderableList.DoDraggingAndSelection (UnityEngine.Rect listRect) (at C:/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:767)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect) (at C:/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:593)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at C:/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:412)
Opsive.UltimateCharacterController.Editor.Inspectors.Utility.ReorderableListSerializationHelper.DrawReorderableList (UnityEditorInternal.ReorderableList& reorderableList, Opsive.UltimateCharacterController.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:75)
Opsive.UltimateCharacterController.Editor.Inspectors.Character.UltimateCharacterLocomotionInspector.<GetDrawCallback>b__32_0 () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Character/UltimateCharacterLocomotionInspector.cs:291)
Opsive.UltimateCharacterController.Editor.Inspectors.StateSystem.StateBehaviorInspector.OnInspectorGUI () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:92)
UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
In the latter case, I get the following error and when I exit Play mode, the ability is no longer in the abilities list in the UCL script.
C#:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.Awake () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:302)
I am able to replicate #1 in the Demo Scene, but haven't setup cross-scene loading with Demo to test #2.