Items / Spawn Items

This page is about spawning Item Actors into the world for the players to pick up. If you want to add items directly to the player's inventory or another storage component, see the Add Items page instead.

The Item Pickup Blueprint

When you hand place, spawn at runtime, or drop an item as a player into your world by default it will be spawned using the BP_Interactable_ItemPickup blueprint found in the Blueprints/Interactables/ folder. This is the same blueprint that is used for all of the different item pickups in the demo world. It is also the blueprint that is spawned when our player drops an item.

We will go over the different ways to use it in a moment, but first here is a breakdown of the configuration variables available to us on this blueprint. We will need to set some of these variables for each of our spawned items.

BP_Interactable_ItemPickup Variables

ItemRowName Required The Row Name for the item you wish to spawn, as defined when you created the item.
ItemQuantity Required The quantity of the ItemRowName the player will get when they pick up the spawn.
OverrideDefaultData Override or append the default dynamic data.
DespawnSeconds The number of seconds before the item is despawned. Countdown starts on spawn. Set to 0 (default) to keep it from despawning until the game (or server) restarts.
UsePhysics? If true (default) the item will use physics on spawning and while moving, up until MaxPhysicsTime. If the item stops moving or this time is reached physics will be disabled.
MaxPhysicsTime If UsePhysics? is enabled, this is the maximum number of seconds physics is enabled, after which it is then automatically disabled. If the object stops moving physics is disabled, which on most cases will be less then this value.
There are additional variables exposed in this blueprint related to interaction. These are inherited from the parent BP_Interactable which is the base abstract class for all interactables in this asset. You can learn more about this blueprint, and the other included interactables in the Interaction System chapter.

Hand Place Items in your Level

If you would like to hand place items in your level while in editor mode you can start by navigating to the Blueprints/Interactables/ folder and selecting BP_Interactable_ItemPickup. Drag and drop this blueprint into the level where you want the item to spawn. When you first drop this blueprint in the level it will be a grey box, after you enter the ItemRowName it will load your mesh. Make sure you also set your ItemQuantity. That is it! The player will now be able to pickup your item. If you run into any issues see the Most common problems section at the bottom of this page.

Hand Place Faster with Reusability

You can also inherit from this blueprint if you would like to prefill the item data for quicker reusability and data consistency. To inherit from this blueprint right click on the BP_Interactable_ItemPickup in your content browser and select Create Child Blueprint Class. Give a name to your new item pickup. Then open the blueprint and prefill your item information in the Details section. Now when you want to spawn this particular item you can just drop this new blueprint in and you won’t have to re-enter the info every time.

Spawn an Item into the world at Runtime

To spawn an item at runtime you would make a call to Spawn Actor From Class. This is a native Unreal Engine function. From the node set the class to BP_Interactable_ItemPickup. Fill out the remaining variables on the node to spawn your item. Provide the location of the spawn using the Transform input pin. In multiplayer games make sure you only call Spawn Actor From Class from the server.

Create a custom Item Pickup Blueprint

Under the surface an item pickup is just adding an item to an item storage component owned by the player, followed by being destroyed. If you would like to make your own, perhaps a more complex display, you can follow this same principle. If you want to make it work with the interactable system view the Interaction chapter for help integrating it into your own custom interactable.

Also, by default when you drop an item it uses the BP_Interactable_ItemPickup to spawn the item. You can override this to your own custom blueprint through the data table. You do however have to make sure you implement the proper BPI and handle receiving the data. I go over it in full details on the drop item subchapter.

Most Common Spawn & Pickup Related Questions

How do I make the picked up items go in the hotbar first, then the inventory?
How do I auto equip equipment that I pickup?
I don't see the mesh after entering the ItemRowName, where is it?
After pressing play my item is gone, where did it go?
I can't pickup any items at runtime.
My item spawned but it is floating in the air instead of falling to the ground ...
I'm still having trouble spawning my mesh ...