How To Remove Item From Inventory After Use?

Nicky_g_

Member
How's it going?

After staring at the UIS-UCC integration demo all day, I still can't figure out how the frag grenade is deducted from the inventory after use?
In which script is this exchange happening?

Thanks!
 
Here is the stack trace
1611651052710.png
The item amount is adjusted the UCC way and the bridge overrides the default UCC functionality when adjusting the amount of items by adding or removing from the UIS inventory. I hope the makes sense.

A pro-tip in case you want to debug somethin in the integration. At the top of the UltimateInventorySystemBridge file there is a
//#define DEBUG_BRIDGE
Uncomment this and you'll have plenty of logs in the console when things change in the bridge inventory. That's how I got the stack track above
 
Thanks to Sangemdoko's tip I discovered Throwable objects which is what I'm looking for, but I'm stuck on having my throwable object getting reequiped.


I'm able to get the first throwable object to equip and be thrown but I can't get it to reequip the following throwable object from the characters inventory and have it continue to throw the object until it runs out of said object.

I've followed the grenade demo and got it to work with just the UCC but I can't get it to work right with UCC and UIS.

What could I be missing?

Thanks!
 
I would check your animation events - when the item is reequipping it should send a reequip animation event if you aren't using a timer. Take a look at the grenade's throwable item component for an example.
 
Hey Justin!

Thanks for the speedy reply. I've check the reequip animation event and I don't think that is it.

I've done my best to copy the grenade example and I don't understand why only one of my throwable objects is being equipped and not the entire amount. How can I get my throwable objects to equip all of the items and not just only one of them?

Here is a side by side

Thanks again for the help?
 
I would try two things:

- Copy the throwable item from the demo scene to your own scene.
- Copy the throwable item settings from the demo scene to your own scene.

It's really hard to debug without getting in and setting breakpoints.
 
Thank you Justin as always for your speedy replies.

After a bit of experimenting I figured out what the problems were.

1st: I had a call for a prefab attribute on the Grenade Category I duplicated. Silly me.
2nd: I had only one element in the prefabs array which caused only one item to be equipped and be useable. I would like to be able to throw just one object from one hand and not both but with time I'm sure I will figure that out.
InkedGrenade Prefabs_LI.jpg

More importantly I need to figure out how to attach better data when I ask questions. Do you have a tutorial or an example of how I can use Breakpoints to give better information of problems?

I know this won't be the last issue I'll be running into :)

Thanks as always!
 
Top