Reference Verse compiles

Conjuring Shells: SpawnProp at Runtime

Placing props by hand is fine for scenery, but a collectible hunt needs shells that appear in fresh spots every round. Verse's `SpawnProp` lets your device conjure a `creative_prop` out of a `creative_prop_asset` at any position you choose while the game is running — and `Dispose` sweeps them away again. Coral the flamingo calls it beach magic; the compiler calls it a `tuple(?creative_prop, spawn_prop_result)`.

Updated Examples verified on the live UEFN compiler
Watch the Knotspawn_prop in ~90 seconds.

Overview

Most props on your island are placed by hand in the editor. But sometimes you need props to appear during play: a bridge that builds itself as a player approaches, loot crates that pop onto a dock when a plate is triggered, or a defensive wall summoned where the player is aiming. That is what SpawnProp is for.

SpawnProp lives on the creative_device (via creative_device_base). You hand it a creative_prop_asset (a reference to the mesh/prop you want) plus a Position and Rotation (or a full Transform), and it drops a live creative_prop into the world. It returns a tuple: an optional creative_prop (the thing you spawned, if it worked) and a spawn_prop_result telling you exactly what happened — success, or a specific failure like being out of bounds or over the prop quota.

Because props spawned this way behave identically to hand-placed ones, you can move them, teleport them, and store references to them for later. Combine SpawnProp with fort_character.GetViewLocation() and the character locomotion queries (IsCrouching, IsOnGround, etc.) and you can spawn props precisely where and when a player is doing something specific — like crouching on the shore.

Reach for SpawnProp whenever the set of props in the world needs to change at runtime rather than being fixed at design time. Note the quota: 100 props per script device, 200 total per island — plan around it.

API Reference

(API surface could not be resolved for this device.)

Walkthrough

The moment: A player walks out onto the wooden dock at the edge of the sunny cove. When they crouch while standing on the ground, we spawn a stack of supply crates right where they are looking — as if they set the crates down themselves. We handle every failure result so nothing silently breaks.

To make this run, place a Trigger Device on the dock (we'll use its TriggeredEvent as the "do it now" pulse), and in the Verse device's Details panel set the CrateAsset field to a prop asset of your choosing.

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

# Spawns a stack of crates where a crouching player is looking, on trigger.
dock_crate_spawner := class(creative_device):

    # The prop to spawn. Set this in the Details panel to any creative_prop_asset.
    @editable
    CrateAsset : creative_prop_asset = DefaultCreativePropAsset

    # A trigger placed on the dock. Stepping on it fires the spawn attempt.
    @editable
    DockTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        # Subscribe the trigger's event to our handler method.
        DockTrigger.TriggeredEvent.Subscribe(OnDockTriggered)

    # TriggeredEvent hands us a (?agent). Unwrap it before use.
    OnDockTriggered(MaybeAgent : ?agent):void =
        if (Agent := MaybeAgent?):
            TrySpawnCrates(Agent)

    # Verify the player is crouching on the ground, then spawn at their view location.
    TrySpawnCrates(Agent : agent):void =
        if:
            Character := Agent.GetFortCharacter[]
            Character.IsOnGround[]
            Character.IsCrouching[]
        then:
            # Spawn at the point the character is looking/aiming from.
            SpawnLocation := Character.GetViewLocation()
            SpawnCrateAt(SpawnLocation)

    # Call SpawnProp and branch on the real spawn_prop_result.
    SpawnCrateAt(Location : vector3):void =
        # SpawnProp needs a rotation; keep the crate upright.
        Upright := IdentityRotation()
        Result := SpawnProp(CrateAsset, Location, Upright)
        case (Result(1)):
            spawn_prop_result.Ok =>
                # Result(0) is a ?creative_prop we could store if we wanted.
                if (Crate := Result(0)?):
                    Print("Crate spawned on the dock!")
            spawn_prop_result.InvalidSpawnPoint =>
                Print("Spawn point had NaN/Inf.")
            spawn_prop_result.SpawnPointOutOfBounds =>
                Print("Spawn point outside the island.")
            spawn_prop_result.InvalidAsset =>
                Print("CrateAsset is not a valid prop.")
            spawn_prop_result.TooManyProps =>
                Print("Hit the prop quota.")
            spawn_prop_result.UnknownError =>
                Print("Unknown spawn error.")

Line by line:

  • The four using directives pull in devices, fort_character (for GetViewLocation, IsCrouching, IsOnGround), simulation events, and vector3/rotation from SpatialMath.
  • CrateAsset : creative_prop_asset is declared as an @editable field — that is how the prop asset becomes selectable in the Details panel. DefaultCreativePropAsset is the placeholder default.
  • DockTrigger is a real placed device; you must declare it as a field to call it. We subscribe its TriggeredEvent in OnBegin.
  • TriggeredEvent delivers a (?agent). if (Agent := MaybeAgent?) unwraps the optional so we have a concrete agent.
  • TrySpawnCrates uses a failable if block: GetFortCharacter[] gets the character (may fail), then IsOnGround[] and IsCrouching[] are <decides> queries that only succeed when true. If any fails, nothing spawns — exactly the gating we want.
  • GetViewLocation() returns a vector3 — the exact point the player is aiming from — which becomes our spawn position.
  • SpawnProp(...) returns tuple(?creative_prop, spawn_prop_result). We case on Result(1) (the result enum) and handle every branch, unwrapping Result(0)? on success to get the live creative_prop.

Common patterns

Spawn from a transform (position + rotation + scale)

There is a SpawnProp overload that takes a full transform, letting you control scale as well. Here we spawn a prop at a fixed clifftop location when the game begins.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

cliff_beacon_spawner := class(creative_device):

    @editable
    BeaconAsset : creative_prop_asset = DefaultCreativePropAsset

    OnBegin<override>()<suspends>:void =
        # Build a transform: a spot on the clifftop, upright, at normal scale.
        Where : transform = transform:
            Translation := vector3{ X := 1200.0, Y := 500.0, Z := 300.0 }
            Rotation := IdentityRotation()
            Scale := vector3{ X := 1.0, Y := 1.0, Z := 1.0 }
        Result := SpawnProp(BeaconAsset, Where)
        if (Result(1) = spawn_prop_result.Ok, Beacon := Result(0)?):
            Print("Clifftop beacon placed.")

Teleport a spawned prop after it exists

Once you hold a creative_prop reference, you can move it. Props expose TeleportTo — the same full-transform teleport TeleportTo supports. Here we spawn a buoy at the shore, then teleport it out into the cove.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

shore_buoy_spawner := class(creative_device):

    @editable
    BuoyAsset : creative_prop_asset = DefaultCreativePropAsset

    OnBegin<override>()<suspends>:void =
        ShoreSpot := vector3{ X := 0.0, Y := 0.0, Z := 100.0 }
        Result := SpawnProp(BuoyAsset, ShoreSpot, IdentityRotation())
        if (Result(1) = spawn_prop_result.Ok, Buoy := Result(0)?):
            # Drift the buoy out into the water.
            CoveSpot := vector3{ X := 800.0, Y := 0.0, Z := 100.0 }
            if (Buoy.TeleportTo[CoveSpot, IdentityRotation()]):
                Print("Buoy drifted into the cove.")

Gate spawning on locomotion state

Beyond crouching, you can react to other fort_character states. Here a prop only spawns if the player is in the air (e.g. mid-jump off the dock) — using IsInAir[].

using { /Fortnite.com/Devices }
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

airdrop_spawner := class(creative_device):

    @editable
    DropAsset : creative_prop_asset = DefaultCreativePropAsset

    @editable
    JumpTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        JumpTrigger.TriggeredEvent.Subscribe(OnJump)

    OnJump(MaybeAgent : ?agent):void =
        if:
            Agent := MaybeAgent?
            Character := Agent.GetFortCharacter[]
            Character.IsInAir[]
        then:
            Where := Character.GetViewLocation()
            Result := SpawnProp(DropAsset, Where, IdentityRotation())
            if (Result(1) = spawn_prop_result.Ok):
                Print("Airdrop spawned mid-jump!")

Gotchas

  • SpawnProp returns a tuple, not just the prop. Result(0) is a ?creative_prop (unwrap with Result(0)?) and Result(1) is the spawn_prop_result. Always check the result before trusting the prop exists.
  • Handle every failure branch. spawn_prop_result includes InvalidSpawnPoint, SpawnPointOutOfBounds, InvalidAsset, TooManyProps, and UnknownError. Ignoring these turns real problems into silent no-ops.
  • Prop quotas are real. 100 props per script device, 200 per island. Spawning in loops without cleanup will hit TooManyProps.
  • Declare the asset as an @editable field. A creative_prop_asset must be set in the Details panel; use DefaultCreativePropAsset as the default so it compiles before you assign a real prop.
  • The locomotion queries are <decides> — use them in failable context. IsCrouching[], IsOnGround[], IsInAir[] succeed or fail; call them with [] inside an if block, not as booleans.
  • GetViewLocation() is where the player aims from, not where they stand. For a crate at the player's feet you may prefer their character position; view location is ideal for "place it where I'm looking" mechanics.
  • Int↔float never auto-converts. vector3 components are floats — write 100.0, not 100.
  • Positions and rotations are in centimeters and world space; a scale defined on the creative_prop_asset is applied on spawn unless you use the transform overload to override it.

Build your own lesson with spawn_prop

Generate a personalized, step-by-step lesson plan built around this object — grounded in this exact reference and our compile-verified knowledge base.

Build a lesson →