Functions
Each inventory item is an object of the UObject type. With the help of many functions in the inventory component, we can obtain a reference to this item. But what should we do with it?
For example, we obtained a reference to an item using this method. Having the reference, we can extract the necessary information from this item. For instance, the number of rounds or items in a stack, whether this item is a weapon or ammunition. Additionally, we can determine the class of ammunition that we can use to search for rounds in the inventory for the weapon.
Here is a useful list of functions that you can call from an item:
But how else can we get a link to an inventory item? Here are examples. These functions can be called from the inventory component:
Also, from the delegates:
What actions can we take when we have a reference to an element? We can remove it, change the amount of item or ammo. Here are the functions that will help you with this:
But is it really necessary to have a reference to the item if we simply want to remove one item of a certain class? Absolutely not. There are numerous functions that can help us determine how many items of a certain class are left in the inventory and which one we need to remove.
I will provide a list of functions that you can use: