# Handing Item Drop/Pickup

**URL:** <https://forums.unrealengine.com/t/handing-item-drop-pickup/8463>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [July 29, 2014, 11:38pm UTC](https://forums.unrealengine.com/t/handing-item-drop-pickup/8463 "2014-07-29T23:38:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sarr](https://forums.unrealengine.com/u/Sarr)\
**Post date:** [July 29, 2014, 11:38pm UTC](https://forums.unrealengine.com/t/handing-item-drop-pickup/8463/1 "2014-07-29T23:38:27Z")

</div>

Hi there,  
Currently im working on a Item system for my game and i want the character to be able to pickup and drop items at the moment, i do this the following way,

My Item is a blueprint based on (c++)MyItemClass which is based on AStaticMeshActor, and i have 1 blue print per every item.

when Item is picked up, i add it to the Players inventory and then i set the Items StaticMeshComponent-\>SetStaticMesh(NULL);

when the player drops the item, i set the Items position to front of the character and do StaticMeshComponent-\>SetStaticMesh(Mesh); (i assign Mesh in Item::BeginPlay() by doing Mesh = StaticMeshComponent-\>StaticMesh)

is there a better way of doing this? will this impact the performance in any way?

I’ve tried to do StaticMeshComponent-\>DestroyComponent() when i pick the item up , but i have no idea how to recreate the StaticMeshComponent once i drop the item , and how to get a functioning reference to the original static mesh, the item is using.  
I’ve tried to follow quite few tutorials on how to create a StaticMeshComponent on runtime, but i either have a problem getting the original mesh, or the item doesn’t appear in the world.

Any help would be much appreciated

---

<div class="post-metadata">

**Author:** ![Tom\_Looman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tom_looman/32/1215549_2.png) [@Tom\_Looman](https://forums.unrealengine.com/u/Tom_Looman)\
**Post date:** [July 29, 2014, 11:44pm UTC](https://forums.unrealengine.com/t/handing-item-drop-pickup/8463/2 "2014-07-29T23:44:22Z")

</div>

Hi,

I’ve dealt with this issue before, to be honest I haven’t decided on what is “best” and I’ve seen people using different approaches.

For player inventory I decided to split the items into multiple blueprints, one for in-world the other for in-inventory. This does build up to a lot of blueprints in the basic implementation, but you would probably end up using a DataTable once your item size grows beyond just a few.

Here is how I did my inventory system: [http://www.tomlooman.com/tutorial-basic-inventory-system-in-blueprint/](http://www.tomlooman.com/tutorial-basic-inventory-system-in-blueprint/)  
I’d say this isn’t perfect and I might make adjustments as the system expands (for example DataTables would have a big effect on this system and keeps number of unique BPs to a minimum)

More info on datatables:

> **[Data Driven Gameplay Elements](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/DataDriven/)**
>
> Driving gameplay elements using externally stored data.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...
