Magic item UIS + UCC

SOSolacex

Member
Hey, I am currently having an issue setting up a magic spell that heals my player.
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.ThirdPersonController.Items.ThirdPersonMagicItemProperties.Awake () (at Assets/Opsive/UltimateCharacterController/Scripts/ThirdPersonController/Items/ThirdPersonMagicItemProperties.cs:37)
UnityEngine.GameObject:SetActive(Boolean)
Opsive.UltimateCharacterController.FirstPersonController.Items.FirstPersonPerspectiveItem:SetActive(Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/FirstPersonController/Items/FirstPersonPerspectiveItem.cs:522)
Opsive.UltimateCharacterController.Items.Item:SetVisibleObjectActive(Boolean, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:607)
Opsive.UltimateCharacterController.Items.Item:Equip(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:469)
Opsive.UltimateCharacterController.Inventory.InventoryBase:EquipItem(IItemIdentifier, Int32, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:350)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:ItemEquip(Int32, Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:1044)
Opsive.Shared.Game.SchedulerBase:AddEventInternal(Single, InvokeLocation, Action`2, Int32, Boolean)
Opsive.Shared.Game.SchedulerBase:ScheduleFixed(Single, Action`2, Int32, Boolean)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip:Update() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:654)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdateAbilities(Ability[]) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:809)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:UpdateUltimateLocomotion() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:740)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:Move(Single, Single, Single) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:481)
Opsive.UltimateCharacterController.Game.KinematicCharacter:Move(Boolean) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:236)
Opsive.UltimateCharacterController.Game.KinematicObjectManager:FixedUpdate() (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:879)

Screenshot_65.pngScreenshot_67.png

I am not sure what exactly is missing; origin location is empty but there's the ID which should work. Only equipping gives me this error but it does equip; unequipping works fine.

As for the actual spell I doubt these are the correct settings to get a healing spell on the player itself to work, but I'd appreciate some pointers regardless. https://prnt.sc/1w523pb
 

Attachments

  • Screenshot_65.png
    Screenshot_65.png
    90.1 KB · Views: 3
The error at line 37 means the weapon couldn't find the player. Meaning the item was spawned incorectly (outside of the player hierarchy), this can happen if the Item Slot ID was missing (which is not your case since you clearly have it) or because the Item Set Manager tried to spawn the item somewhere else.

Have a look at your Item Set Rules within the Inventory Item Set Manager and check that you indeed have a slot count that contains the magic slot ID 2 (meaning you need at least a slot count of 3)

1634283680737.png

Also ensure that your other item set rules do NOT contain a parent of the magic Item Category within another slot, otherwise the item might try to be equipped in the wrong slot which isn't allowed. For example if you had an Item Set Rule with "Equippable" in slot 0, the magic item set manager will try to spawn the item in slot 0 and will fail giving you the error above.

I'm not sure about the healing spell setup itself, nothing strikes as being incorrect in your screen shot.
 
Unfortunately I've not been able to resolve this issue. Everything you told me is set correctly and does not have equippable as parent.
 
Could you send me a screenshot of your Inventory Item Set Manager inspector at runtime after equipping the magic item?
That should show the Item Set with the magic item and it might help us debug this problem.

Perhaps a video recording of you replicating the error and showing your setup might help me see what's wrong.
 
Top