Need Help with my picking up and dropping Item System

Hi everyone,

I’m fairly new to Unreal Engine and have been working on a pick-up and drop system for boxes. I’ve set up a line trace system for picking up boxes, as I wanted to avoid issues with picking up random boxes when they’re clustered together. However, I’m facing a couple of issues that I need help with:

Issues:
Item Deletion Issue:

Currently, when I press the middle mouse button to pick up a box, it deletes from the floor which is perfect but if I press middle mouse button again it deletes it I want a different button to drop the box Eg: G also when I pick up another box it deletes the one in my hand if I want it so I have to drop the box before picking up new one

Spawning and Dropping Boxes:

I want to spawn a new box at the location where the original box is in my hand up when pressing a different key (e.g., G). so it falls down to the floor or even a throw separate feature so I can drop it or throw it.

Current Setup:
Pick-Up System:

I’m using a line trace to detect and pick up boxes.
I’ve followed some tutorials but haven’t found one that matches my exact needs, especially for clustered boxes so I decided to use my knowledge I have got in the last few days of learning to make this system you see now.

Blueprints:

I have screenshots and a video showing my current blueprint setup and the issue at hand.

What I Need Help With:

Preventing Box Deletion:

How can I modify my blueprint to ensure that the box is not deleted when pressing middle mouse button again,

Spawning a New Box for dropping:

How can I spawn a new box at the position of the current picked-up box and ensure it drops to the ground when pressing a specific key?

I’ve attached a video and screenshots of my blueprints to provide more context. Any guidance or specific steps to resolve these issues would be greatly appreciated!

Thank you in advance for your help!

Link for video of issue: https://youtu.be/M-wAg2V6QTg



Based off the pictures alone, middle mouse button does nothing, so that parts “solved” already

But as far as the deletion/drop item it looks like you don’t have a create static mesh node before it gets deleted

Anytime you pickup the object should be deleted then represented in inventory
Anytime you drop the opposite applies, you create a mesh/object and then subtract it from inventory

This DataAsset Video and This Inventory Video may help if you can understand what’s going on, inventory is a tad more complex than it seems on the surface

When you use the destroy actor node, nothing else will happen after that, ex destroy actor, spawn actor ( spawn actor will never fire as it needs to be before the destroy actor )

So what i’d do is:
“HeldItem” > “isvalid” ( meaning you have an item in hand ) > “spawnactor” ( at this point it dosen’t matter if you just override it with the next item as you’ve dropped it on the ground ) > set mesh

This will work for single item inventory but i’d work on understanding the two videos i linked or play around with data assets in some other way as There’s tons of okay and Very similar to what you may be wanting to do methods

Sorry this isn’t an exact answer but it should at least lead you in the right direction and give some idea