Melee Body Lot Of Errors

serenity

Member
My character Agent had zero errors when it had shootable weapons but when I created the same character but with only a melee body item the following errors appear in console:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Items.Item.IsActive () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:624)
Opsive.UltimateCharacterController.Items.Item.set_ShowFullScreenUI (System.Boolean value) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:134)
Opsive.UltimateCharacterController.Items.Item.Equip (System.Boolean immediateEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:469)
Opsive.UltimateCharacterController.Inventory.InventoryBase.EquipItem (Opsive.UltimateCharacterController.Inventory.ItemType itemType, System.Int32 slotID, System.Boolean immediateEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:360)
Opsive.UltimateCharacterController.Character.Abilities.Items.EquipUnequip.OnPickupItem (Opsive.UltimateCharacterController.Items.Item item, System.Single count, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:213)
Opsive.UltimateCharacterController.Events.InvokableAction`4[T1,T2,T3,T4].Invoke (T1 arg1, T2 arg2, T3 arg3, T4 arg4) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/InvokableAction.cs:225)
Opsive.UltimateCharacterController.Events.EventHandler.ExecuteEvent[T1,T2,T3,T4] (System.Object obj, System.String eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4) (at Assets/Opsive/UltimateCharacterController/Scripts/Events/EventHandler.cs:494)
Opsive.UltimateCharacterController.Inventory.InventoryBase.ItemTypePickup (Opsive.UltimateCharacterController.Inventory.ItemType itemType, System.Single count, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:277)
Opsive.UltimateCharacterController.Inventory.InventoryBase.PickupItemType (Opsive.UltimateCharacterController.Inventory.ItemType itemType, System.Single count, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip, System.Boolean notifyOnPickup) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:222)
Opsive.UltimateCharacterController.Inventory.InventoryBase.PickupItemType (Opsive.UltimateCharacterController.Inventory.ItemType itemType, System.Single count, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:194)
Opsive.UltimateCharacterController.Inventory.InventoryBase.LoadDefaultLoadout () (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:134)
Opsive.UltimateCharacterController.Inventory.InventoryBase.Start () (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:119)

And when I attempt to Aim and Use Punching extra errors occurs:

NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Items.Item.GetVisibleObject () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Item.cs:615)
Opsive.UltimateCharacterController.Items.Actions.UsableItem.UseItem () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/UsableItem.cs:235)
Opsive.UltimateCharacterController.Items.Actions.MeleeWeapon.UseItem () (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/MeleeWeapon.cs:802)
Opsive.UltimateCharacterController.Character.Abilities.Items.Use.LateUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Use.cs:633)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateActiveAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities, System.Int32& abilityCount) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1018)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.LateUpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1004)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdatePositionAndRotation () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:814)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.UpdatePositionAndRotation (System.Boolean fromAnimatorMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:526)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:1484)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.OnAnimatorMove () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1740)

The AI seems to punch when I use the abilities via code as such:
Code:
_characterLookSource.Target = aimTarget;
        _character.TryStartAbility(aimItemAbility);
        _character.TryStartAbility(useItemAbiltiy);
 
Last edited:
Yes I have added the colliders for both arms and refrenced them in hitboxes section according to this tutorial:

 
It doesn't look like your melee weapon is setup properly. I would go through this video again just to make sure you didn't miss a step. Before you get to the positioning/using aspect make sure it first equips correctly. The body ItemType is a special case because it doesn't have any visible items so try getting the sword working first just to get familiar with the workflow.
 
Thanks It seems to be working for now, will keep you posted.

I think one of the things below caused it:
If I uncheck the "Add 3rd Person Item" checkbox, I think for Melee Body it has to be ticked even if no actual item gameobject is referenced in the feld below it.

I also initially created the item setting in as "Nothing" as opposed to "Melee" (Under the add 3rd person item I mentioned above) although I realized this and fixed it later it seems to have messed something up.

What do you thing of the above might have caused it.
 
Top