Home › How do I…? › How to let players spawn objects into their hand

How to let players spawn objects into their hand

Advanced Framework Pro's spawner shows a hologram of an object; when the player grabs it, the real actor is spawned and handed straight to the grip, with no visible pop. Dropped copies despawn on a timer, so a scene can offer tools and parts without pre-placing them or leaking actors. By the end of this you will have a stand the player can pull fresh copies from, in single player and in multiplayer.

At a glance

Level or rack actor
└─ BPC_Spawner (component)
   Spawn Class = your grabbable actor, preview mesh (hologram),
   single instance (bool), despawn time, Spawn Sound
Player controller (multiplayer only)
└─ BPC_PlayerController_ReplicatedSpawner
Runtime: Update Spawner (class + preview), Set Spawner State (show / hide / delete)
Spawned copies carry BPC_Helper_SpawnedActor (despawn timer)

Steps

  1. The class you spawn must be grabbable; see How to make an object grabbable.
  2. Add a BPC_Spawner component to an actor of your own, such as a rack or a table, where the hologram should stand.
  3. Set Spawn Class to the actor to spawn and give it the mesh to show as the hologram.
  4. Choose whether only one instance may exist at a time, and set the despawn time a released copy survives.
  5. Optionally set a Spawn Sound.
  6. For multiplayer, add BPC_PlayerController_ReplicatedSpawner to your player controller, so the server spawns and the requesting player owns the result.
A freshly spawned object already in the player's hand
AFM_Spawner_result.pngA freshly spawned object already in the player's hand
A freshly spawned object already in the player's hand

Notes

Call Update Spawner to swap the class and the preview at runtime, so one stand can offer different things without being rebuilt.

Set Spawner State shows, hides or deletes the hologram; use it to make a spawner available only at the right step.

BPC_Helper_SpawnedActor is added to each spawned copy: releasing it starts the despawn countdown, picking it up again cancels it.

Multiplayer

Spawn through the replicated spawner, never with a plain Spawn Actor, or other players cannot pick the object up.

Map_Examples_Spawner offers a hologram of a showroom shape on a pad, with the type, the despawn time and the reset scale switchable from the table, a rifle stand that hands out one rifle at a time, and a widget panel to spawn from.