Unlimited Item Pickup Issue

Hello Devs, I have an inventory system that so far works perfectly. I am able to pick items up, have the actor destroyed and have it added to my inventory with the icon adding to the inventory ui. My issue is I have four slots displayed for my inventory and I would like some help implementing like a counter of some sort that basically prevents the actor from being destroyed and picking up an item if it goes over the four slots. Currently I am able to pick up an unlimited amount of items even if all of the slots are filled. Here are screenshots of all of the main blueprints that are in use.

Main Char Bp

Add Item Function

Add New Item Function

Find Item Function

Event Graph for the three functions above

Destroy Actor Bp for items

You could write a ‘is addable’ function that you can call right before ‘add item’.

You can make two integer variables “itemcount” and “inventoryspace” and After the input action you check with a branch if “itemcount” is equal to “inventoryspace” if it isnt you proceed with the line trace otherwise you stop. Then when you add or pick up an item you make a set for “itemcount” and add to it One, when you drop an item you remove One to it. So with this method you can make the inventory as big as you like .

On interact check inventory space. If space is available, do the line trace.

Worked like a charm I really appreciate it!