Runtime Pickup Error

BJPickles

Member
Created a new shotgun item type
Created new bullet item type

Created a shotgun (anim type 3)
1668937736434.png
Created a runtime pickup for the shotgun:
1668937698355.png

When I walk into the runtime pickup, it equips the shotgun but doesn't trigger the animations.
Video:
Error:
Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Items.Actions.CharacterItemAction.InvokeOnModulesWithTypeConditional[Tm,T1] (T1 i1, System.Func`3[T1,T2,TResult] action, System.Boolean returnOnTrue) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/CharacterItemAction.cs:474)
Opsive.UltimateCharacterController.Items.Actions.ShootableAction.ShouldReload (Opsive.UltimateCharacterController.Items.CharacterItem characterItem, Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Boolean fromPickup) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/Actions/ShootableAction.cs:583)
Opsive.UltimateCharacterController.Character.Abilities.Items.Reload.ShouldReload (Opsive.UltimateCharacterController.Items.CharacterItem characterItem, Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Boolean fromPickup) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Reload.cs:424)
Opsive.UltimateCharacterController.Character.Abilities.Items.Reload.OnTryReload (System.Int32 slotID, Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Boolean immediateReload, System.Boolean equipCheck) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Reload.cs:373)
Opsive.UltimateCharacterController.Character.Abilities.Items.Reload.OnPickupItemIdentifier (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 amount, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/Reload.cs:346)
Opsive.Shared.Events.InvokableAction`4[T1,T2,T3,T4].Invoke (T1 arg1, T2 arg2, T3 arg3, T4 arg4) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2,T3,T4] (System.Object obj, System.String eventName, T1 arg1, T2 arg2, T3 arg3, T4 arg4) (at <f8e88e939b08494e9e6a74df2ca4dcad>:0)
Opsive.UltimateCharacterController.Inventory.InventoryBase.OnItemIdentifierPickedUp (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 amount, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:690)
Opsive.UltimateCharacterController.Inventory.InventoryBase.OnCharacterItemSpawned (Opsive.UltimateCharacterController.Items.CharacterItem characterItem) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:801)
Opsive.UltimateCharacterController.Inventory.Inventory.OnCharacterItemSpawned (Opsive.UltimateCharacterController.Items.CharacterItem characterItem) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/Inventory.cs:321)
Opsive.UltimateCharacterController.Items.CharacterItem.Initialize (System.Boolean force) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/CharacterItem.cs:284)
Opsive.UltimateCharacterController.Items.CharacterItem.Initialize (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier) (at Assets/Opsive/UltimateCharacterController/Scripts/Items/CharacterItem.cs:348)
Opsive.UltimateCharacterController.Inventory.InventoryBase.SpawnCharacterItem (Opsive.UltimateCharacterController.Items.CharacterItem characterItemPrefab, Opsive.Shared.Inventory.IItemIdentifier itemIdentifier) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:837)
Opsive.UltimateCharacterController.Inventory.InventoryBase.SpawnItemIdentifiersCharacterItem (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 addToSlotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:768)
Opsive.UltimateCharacterController.Inventory.InventoryBase.AddItemIdentifierAmount (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 amount, System.Boolean spawnCharacterItems, System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:578)
Opsive.UltimateCharacterController.Inventory.InventoryBase.PickupItem (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 amount, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip, System.Boolean notifyOnPickup, System.Boolean spawnCharacterItems) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:631)
Opsive.UltimateCharacterController.Inventory.InventoryBase.PickupItem (Opsive.Shared.Inventory.IItemIdentifier itemIdentifier, System.Int32 amount, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Inventory/InventoryBase.cs:605)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickup.DoItemIdentifierPickupInternal (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickup.cs:74)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoItemIdentifierPickup (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean forceEquip) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:136)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoItemPickup (UnityEngine.GameObject character, Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID, System.Boolean immediatePickup, System.Boolean pickupItemIdentifier) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:98)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.TryItemPickup (Opsive.UltimateCharacterController.Inventory.InventoryBase inventory, System.Int32 slotID) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:70)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.DoPickup (UnityEngine.GameObject target) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:59)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ItemPickupBase.TriggerEnter (UnityEngine.GameObject other) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ItemPickupBase.cs:38)
Opsive.UltimateCharacterController.Objects.CharacterAssist.ObjectPickup.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Opsive/UltimateCharacterController/Scripts/Objects/CharacterAssist/ObjectPickup.cs:165)
 
Last edited:
To update on this, I've re-added a new Rose_Shotgun, and then manually added it to the item type.

1668938642808.png

I copied the demo shotgun action template and it gave me 2 sets of fire point, shell ejection etc.

1668938709821.png

I still had to manually add crosshair and icon.

1668938731087.png

I also had to manually add the "Shootable" action name.

1668938769525.png

Now I've double checked my runtime pickup. Message to tell me when it's added.

1668938833370.png


I've setup my item set manager as follows:

This is what the rule looks like:
 
I've noticed at runtime that the item sets are empty?

1668939244203.png

I've re-setup the rule to mimic the demo shotgun. No idea what was different but it seems to work.
1668939567072.png
 
Top