Pickup/Drop blueprint object from inventory

Hi guys!

I started creating a game recently that requires me to make an inventory system. I had no problem at the start with the inventory ui and the pickups of meshes but i soon ran into a problem when trying to drop a blueprint (a flashlight) by dettaching it from the character and then spawning it in the world. The issue was that when i tried to pick it up again, I couldn’t and it wouldn’t appear in my character’s hands when picked up. Could someone please help me solve this problem.

The flashlight might have a big offset location during the attachment, try a print string of it location after attachment.

You will need to play around with the location of the attachment like Location Rule = SnapToTarget or Keep Relative.

If it really bug out, you can set the world location of your flashlight close to your arm socket world location just before the attachment.

Thank you for your help, it helped me solve the problem ! Sadly I just ran into another one soon after. When I tried switching items from one inventory slot to another, it would replicate the item and i get an error.

1 Like

Here’s the code in question

That a weird error :face_with_spiral_eyes:

Try to add this node to your code to validate your class varaible:

From what i have look in the cpp error msg, it just doing a IsValidClass too:

Somehow your class variable is not yet loaded. Try also to not set it in a variable but connect them directly from the pin node of your input function.

1 Like