How can I remove an icon from my HUD when it is removed from my Inventory?

I’m doing a inventory and I have it working with it collecting and selecting items via buttons and dropping them. but at the moment I’m trying to figure out the best way to remove the items icon out of the inventory HUD after the item is dropped.

this is my dropped blueprint and it works. but at the moment I’m not sure on how to remove the items Icon from the inventory and HUD. because at the moment the inventory is empty but the texture is still in the inventory and displays in the HUD when toggled.

this is the HUD blueprint. to toggle the inventory and show what is selected. is there a way to remove the icon from HUD when item is removed.

If you use the “event receive draw hud” it should fire every frame.
Like that all items will be drawn new every frame which means that as soon as you remove something from the inventory array it shouldn’t be drawn inside of your HUD anymore.

What exactly did you try so far and what exactly isn’t working?

I’ve tried to reset the texture for HUD when dropped and it worked but when the item is picked back up or another item it will not show the icon back in the HUD

This the the full HUD Event Graph

This is the Character Event Graph. you can see at the end of the Blueprint I have tried to set the texture2D to remove it. but when the item is picked back up it will not show the icon again in the HUD. Event if I set it in the pickup and add item to Inventory.

At the moment I’m still learning blueprints, and once I get this working my next step is to draw texture simple and add a array of hit boxes and placing the icons in the hit boxes the being able to select from hitbox and drop selected item from inventory.

Oh you shouldn’t just set the texture to “none”. You should remove the index from your array since you don’t check if a texture is none. This will just resolve in one empty field in your inventory which you can’t use. Technically an invisible item.

Just give yourself, whatever you need in your inventory class, in the pickup class and add that to the inventory array again.

This will probably fix this problem since I would think it’s rather hard to find the slot which you cleared before in this function as you don’t save it anywhere.

You can later on add something like position in the inventory (position in the array) or have an array with a fixed size and check which fields are clear and just don’t display anything there (minecraft type inventory).

I’ve never played minecraft. I did try remove index but because I have a inventory already set with 50 slots it didn’t change. I’ll work it out. I have done this so far without any help I’ll work it out eventually. thanks for your input

Alright.
If you use the HUD class and use the “even draw hud” or however it is called exactly, it will be called every frame. Try to keep that in mind and if nothing else helps the “print string” helped me quite often simply outputting some data real quick.

Good luck!

I finally got the inventory working. Using Savai Kun tutorial with the Inventory Display with hitboxes. I found that to get the item to be dropped and spawned in World the Item needs to be in Inventory Index 1. Then when I press drop it spawns Item and removes it from Inventory. the only problem that I have now is that after a minute of the items being in Inventory It clears it and there is nothing in the inventory. How Would I stop the Inventory clearing everything out.

Items can be moved to other hitboxes using Savai Kun tutorial.

Item moved to Inventory Index 1 and button pressed to spawn item In world