Heal magic issue

SOSolacex

Member
I was having some issues with getting my own heal spell to work, so I tried looking at the demo scene.
It seems I did set up my own spell pretty well for the most part, however neither in my scene nor the demo scene, the healing magic actually seems to work.
The animations and particle effects work, however the actual healing does not. This is true in the demo scene.

I decided to check the spell while in play mode, and apparently the impact -> Heal does not display properly (does display properly when not in play mode) and I got this error when trying to check it:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.MagicItemInspector.OnImpactActionListDraw (UnityEngine.Rect rect, System.Int32 index, System.Boolean isActive, System.Boolean isFocused) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Items/Actions/MagicItemInspector.cs:266)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <7587a42c8322471cbc42b27c9b8eab3c>:0)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at <7587a42c8322471cbc42b27c9b8eab3c>:0)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at <7587a42c8322471cbc42b27c9b8eab3c>:0)
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)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.MagicItemInspector.<GetDrawCallback>b__26_0 () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Items/Actions/MagicItemInspector.cs:137)
Opsive.Shared.Editor.Inspectors.StateSystem.StateBehaviorInspector.OnInspectorGUI () (at Assets/Opsive/Shared/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:92)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <0fdaf67e8e744beea25e77915c19f81b>:0)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

Is this what causes the healing spell not to work properly ingame? And how would I go about fixing it?
Thanks in advance!
 
The healing in the demo scene works fine. It does not affect the player but the crates. If you are close to a crate and start healing, the crate will get health points and change color.
 
Wait.. oh wow.
But how do I get it to heal the player then? I tried making it so that the heal should also detect the layer that the player character and its colliders are on but it doesn't do anything.

PS: Heal particles don't get deleted in the demo scene

1654081776219.png
Edit: Fixed it by setting m_CharacterLocomotion.EnableColliderCollisionLayer(false); to true in the code. Not sure if this has bad consequences, but for now it works and I can heal my own character.
 
Last edited:
Top