Items / Drop Items

Default Drop Item Handler

When a player drops an item at runtime the dropItemHandler defined for the item in our data table is what we use to spawn the item in our world. By default this handler is set to BP_Interactable_ItemPickup.

Custom Drop Item Handler

You can create your own custom drop item handlers and assign them in the data table for the item with the dropItemHandler variable. A drop item handler can be any actor blueprint. By default it will be our

To properly use a custom handler you will need to build yours to receive the information about the item, validate the request, and reward the player with the item trying to pick it up. I've included several blueprint interfaces to help cover some of these gaps. If you are new to Blueprint Interfaces you will want to read a tutorial or watch a video on the subject before you proceed.

BPI_ItemPickup

To get information about the item being dropped, and to respond to other systems that it is an item that can be picked up you will need to implement the BPI_ItemPickup blueprint interface and its functions.

setPickupItem This event will be called when your custom class is spawned. It will include the ItemRowName, ItemQuantity, and DynamicData for the item. You can use the getItem global function to get the Item details like the mesh from the ItemRowName.
isPickupItem? This function will be called when the interaction system is checking if this is a pickup item. You are expected to return true or false, along with the details that were provided on the setPickupItem call. This does not auto implement it into the included interaction system, continue below to see how that can be integrated.

BPI_InventorySystem_Interactable

If you want the included interaction system to work with picking up your custom blueprint item pickup you will also need to implement the BPI_InventorySystem_Interactable blueprint interface and its functions.

getInteractableInfo? This function will be called by the interaction system, and from it you should return if it can be interacted with, along with the label to show on the interaction widget. The player controller making the request will be passed through to you if you need it to determine the availability of the interactable.
interactWith This event is called from the interaction system when it is time to interact with your blueprint. It will include a reference to the player controller making the request. From this event you would handle whatever you need to, and then award the player with the item. Take a look at the pickupItem function in the default BP_Interactable_ItemPickup in the Blueprints/Interactables/ to see how it awards the player the items.

If you are using your own interaction system you will want to make sure you are passing a reference of the player controller making the request so your code can give the item to the proper player. The Working in Blueprint / Add Items chapter goes over giving items to the player, you should look that over in addition to reviewing how it is being handled in the pickupItem function included in the default handler BP_Interactable_ItemPickup.

Most Common Drop Item Related Questions

How do I disable dropping of items?
How do I disable dropping for a specific item but allow it for the rest?
It seems after dropping my item it fell through the floor?
I can't pickup any items at runtime.
My item spawned but it is floating in the air instead of falling to the ground ...