Reference Devices compiles

vehicle_spawner_cannon_device: Launch Players from a Cannon

The `vehicle_spawner_cannon_device` lets you place a rideable cannon in your UEFN island and control it entirely from Verse. Want a carnival launcher that auto-assigns a player as driver, resets after each shot, and locks the cannon between rounds? That's exactly what this device is built for. It extends `vehicle_spawner_device`, so every method and event shown here applies to all vehicle spawner types.

Updated Examples verified on the live UEFN compiler

Overview

The vehicle_spawner_cannon_device is a specialized vehicle_spawner_device that spawns and configures a rideable cannon in your island. Drop one in your level, wire it to a Verse device, and you can:

  • Spawn / respawn the cannon on demand (RespawnVehicle)
  • Destroy it mid-round (DestroyVehicle)
  • Auto-seat a player the moment they step on a trigger (AssignDriver)
  • Enable / disable the spawner so players can't interact during setup (Enable / Disable)
  • React to players entering or leaving the cannon, or to the vehicle being spawned or destroyed

Reach for this device whenever you need scripted control over a cannon — timed launches, team-gated access, respawn-on-destroy loops, or cinematic sequences.

API Reference

vehicle_spawner_cannon_device

Specialized vehicle_spawner_device that allows a cannon to be configured and spawned.

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse). Inherited members are merged from vehicle_spawner_device.

vehicle_spawner_cannon_device<public> := class<concrete><final>(vehicle_spawner_device):

Events (subscribe a handler to react):

Event Signature Description
AgentEntersVehicleEvent AgentEntersVehicleEvent<public>:listenable(agent) Signaled when an agent enters the vehicle. Sends the agent that entered the vehicle.
AgentExitsVehicleEvent AgentExitsVehicleEvent<public>:listenable(agent) Signaled when an agent exits the vehicle. Sends the agent that exited the vehicle.
SpawnedEvent SpawnedEvent<public>:listenable(fort_vehicle) Signaled when a vehicle is spawned or respawned by this device. Sends the fort_vehicle who was spawned.
VehicleSpawnedEvent VehicleSpawnedEvent<public>:listenable(tuple()) Signaled when a vehicle is spawned or respawned by this device. Deprecated, use SpawnedEvent instead.
VehicleDestroyedEvent VehicleDestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed. Deprecated, use DestroyedEvent instead.
DestroyedEvent DestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed.

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables this device.
Disable Disable<public>():void Disables this device.
AssignDriver AssignDriver<public>(Agent:agent):void Sets agent as the vehicle's driver.
DestroyVehicle DestroyVehicle<public>():void Destroys the vehicle if it exists.
RespawnVehicle RespawnVehicle<public>():void Spawns a new vehicle. The previous vehicle will be destroyed before a new vehicle spawns.

vehicle_spawner_device

Base class for various specialized vehicle spawners which allow specific vehicle types to be spawned and configured with specialized options.

Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).

vehicle_spawner_device<public> := class<abstract><epic_internal>(creative_device_base):

Events (subscribe a handler to react):

Event Signature Description
AgentEntersVehicleEvent AgentEntersVehicleEvent<public>:listenable(agent) Signaled when an agent enters the vehicle. Sends the agent that entered the vehicle.
AgentExitsVehicleEvent AgentExitsVehicleEvent<public>:listenable(agent) Signaled when an agent exits the vehicle. Sends the agent that exited the vehicle.
SpawnedEvent SpawnedEvent<public>:listenable(fort_vehicle) Signaled when a vehicle is spawned or respawned by this device. Sends the fort_vehicle who was spawned.
VehicleSpawnedEvent VehicleSpawnedEvent<public>:listenable(tuple()) Signaled when a vehicle is spawned or respawned by this device. Deprecated, use SpawnedEvent instead.
VehicleDestroyedEvent VehicleDestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed. Deprecated, use DestroyedEvent instead.
DestroyedEvent DestroyedEvent<public>:listenable(tuple()) Signaled when a vehicle is destroyed.

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables this device.
Disable Disable<public>():void Disables this device.
AssignDriver AssignDriver<public>(Agent:agent):void Sets agent as the vehicle's driver.
DestroyVehicle DestroyVehicle<public>():void Destroys the vehicle if it exists.
RespawnVehicle RespawnVehicle<public>():void Spawns a new vehicle. The previous vehicle will be destroyed before a new vehicle spawns.

Walkthrough

Scenario: A carnival minigame. When a player steps on a pressure plate, they are automatically seated in the cannon. After 3 seconds the cannon is destroyed (simulating a launch) and immediately respawned so the next player can go. The cannon is disabled between rounds and re-enabled when the round starts.

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

# Place this Verse device in your level, then wire the editable fields
# in the Details panel to your placed devices.
cannon_launcher_device := class(creative_device):

    # The cannon vehicle spawner placed in the level.
    @editable
    Cannon : vehicle_spawner_cannon_device = vehicle_spawner_cannon_device{}

    # A pressure plate trigger the player walks onto to board the cannon.
    @editable
    BoardingPlate : trigger_device = trigger_device{}

    # Tracks whether a launch is already in progress so we don't double-fire.
    var LaunchInProgress : logic = false

    # Called when the game starts.
    OnBegin<override>()<suspends> : void =
        # Disable the cannon at the start — the round manager will enable it.
        Cannon.Disable()

        # Subscribe to the boarding plate so we know when a player steps on it.
        BoardingPlate.TriggeredEvent.Subscribe(OnPlayerBoarded)

        # Subscribe to vehicle events for logging / downstream logic.
        Cannon.AgentEntersVehicleEvent.Subscribe(OnAgentEnters)
        Cannon.AgentExitsVehicleEvent.Subscribe(OnAgentExits)
        Cannon.SpawnedEvent.Subscribe(OnCannonSpawned)
        Cannon.DestroyedEvent.Subscribe(OnCannonDestroyed)

        # Enable the cannon now that all subscriptions are wired.
        Cannon.Enable()

    # Called when a player steps on the boarding plate.
    # trigger_device sends ?agent, so we must unwrap it.
    OnPlayerBoarded(MaybeAgent : ?agent) : void =
        if (LaunchInProgress = false):
            if (BoardingAgent := MaybeAgent?):
                set LaunchInProgress = true
                # Seat the player in the cannon immediately.
                Cannon.AssignDriver(BoardingAgent)
                # Run the timed launch sequence on a separate async task
                # so we don't block the event handler.
                spawn { LaunchSequence() }

    # Waits 3 seconds then destroys the cannon (the "launch").
    # RespawnVehicle brings it back for the next player.
    LaunchSequence()<suspends> : void =
        Sleep(3.0)
        # Destroy the vehicle — fires DestroyedEvent.
        Cannon.DestroyVehicle()
        Sleep(1.0)
        # Respawn it — fires SpawnedEvent when ready.
        Cannon.RespawnVehicle()
        set LaunchInProgress = false

    # Fired by AgentEntersVehicleEvent — agent is already unwrapped.
    OnAgentEnters(Agent : agent) : void =
        # You could grant a countdown UI, play a sound cue, etc.
        # Agent is a fully resolved agent here — no unwrapping needed.
        var _unused : logic = false # placeholder for your game logic

    # Fired by AgentExitsVehicleEvent.
    OnAgentExits(Agent : agent) : void =
        var _unused : logic = false # placeholder for your game logic

    # Fired by SpawnedEvent — receives the fort_vehicle that was spawned.
    OnCannonSpawned(Vehicle : fort_vehicle) : void =
        var _unused : logic = false # placeholder — e.g. play a spawn VFX

    # Fired by DestroyedEvent — no payload (tuple()).
    OnCannonDestroyed(Empty : tuple()) : void =
        var _unused : logic = false # placeholder — e.g. play an explosion VFX```

**Line-by-line highlights:**

| Lines | What's happening |
|---|---|
| `@editable Cannon` | Exposes the cannon spawner to the Details panel so you can point it at the placed device. |
| `Cannon.Disable()` | Prevents players from interacting before setup is complete. |
| `BoardingPlate.TriggeredEvent.Subscribe(OnPlayerBoarded)` | Wires the pressure plate to our handler. |
| `Cannon.AgentEntersVehicleEvent.Subscribe(OnAgentEnters)` | `AgentEntersVehicleEvent` sends a plain `agent` (already unwrapped). |
| `Cannon.SpawnedEvent.Subscribe(OnCannonSpawned)` | `SpawnedEvent` sends the `fort_vehicle` — use it to reference the live vehicle object. |
| `Cannon.AssignDriver(BoardingAgent)` | Seats the player immediately — they don't have to climb in manually. |
| `spawn { LaunchSequence() }` | Runs the timed sequence concurrently so the event handler returns instantly. |
| `Cannon.DestroyVehicle()` / `Cannon.RespawnVehicle()` | The core launch loop: destroy then respawn. |

## Common patterns

### Pattern 1 — Round gate: Enable / Disable the cannon between rounds

Use `Enable` and `Disable` to lock the cannon during setup or intermission so players can't jump in early.

```verse
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

cannon_round_gate_device := class(creative_device):

    @editable
    Cannon : vehicle_spawner_cannon_device = vehicle_spawner_cannon_device{}

    # A button players press to start the round.
    @editable
    StartButton : button_device = button_device{}

    OnBegin<override>()<suspends> : void =
        # Lock cannon at match start.
        Cannon.Disable()
        StartButton.InteractedWithEvent.Subscribe(OnRoundStart)

    OnRoundStart(Agent : agent) : void =
        # Unlock the cannon when the round begins.
        Cannon.Enable()
        spawn { DisableAfterDelay() }

    DisableAfterDelay()<suspends> : void =
        # Give players 30 seconds to use the cannon, then lock it again.
        Sleep(30.0)
        Cannon.Disable()

Pattern 2 — Auto-respawn on destruction

Subscribe to DestroyedEvent and call RespawnVehicle so the cannon is always available — great for chaotic sandbox maps.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

cannon_auto_respawn_device := class(creative_device):

    @editable
    Cannon : vehicle_spawner_cannon_device = vehicle_spawner_cannon_device{}

    OnBegin<override>()<suspends> : void =
        Cannon.DestroyedEvent.Subscribe(OnCannonDestroyed)

    # DestroyedEvent sends tuple() — no useful payload, just a signal.
    OnCannonDestroyed(Empty : tuple()) : void =
        spawn { RespawnAfterDelay() }

    RespawnAfterDelay()<suspends> : void =
        # Brief pause so the destruction VFX can finish.
        Sleep(2.0)
        Cannon.RespawnVehicle()

Pattern 3 — Track ride stats with SpawnedEvent and AgentExitsVehicleEvent

Count how many times the cannon has been ridden by listening to both SpawnedEvent (vehicle is fresh) and AgentExitsVehicleEvent (a rider just got out).

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

cannon_stats_device := class(creative_device):

    @editable
    Cannon : vehicle_spawner_cannon_device = vehicle_spawner_cannon_device{}

    @editable
    ScoreManager : score_manager_device = score_manager_device{}

    var TotalRides : int = 0

    OnBegin<override>()<suspends> : void =
        Cannon.SpawnedEvent.Subscribe(OnCannonSpawned)
        Cannon.AgentExitsVehicleEvent.Subscribe(OnRiderExit)

    # SpawnedEvent delivers the fort_vehicle — useful if you need
    # to store a reference to the live vehicle object.
    OnCannonSpawned(Vehicle : fort_vehicle) : void =
        # Reset per-spawn counters here if needed.
        var _ : logic = false

    # Every time a player exits, count it as a completed ride.
    OnRiderExit(Agent : agent) : void =
        set TotalRides = TotalRides + 1
        # Award a point to the rider.
        ScoreManager.SetScore(Agent, TotalRides)

Gotchas

1. AgentEntersVehicleEvent vs AgentExitsVehicleEvent — already-unwrapped agent Both events are typed listenable(agent), so your handler receives a plain agent — no ?agent unwrapping needed. Contrast this with many trigger events that send ?agent and require if (A := MaybeAgent?).

2. DestroyedEvent sends tuple() — there is no payload The handler signature must be (Empty : tuple()) : void. You cannot get the destroyed vehicle or a responsible agent from this event. If you need the vehicle reference, cache it from SpawnedEvent before destruction.

3. SpawnedEvent replaces VehicleSpawnedEvent The older VehicleSpawnedEvent and VehicleDestroyedEvent are deprecated (they send tuple() and carry no vehicle reference). Always use SpawnedEvent (sends fort_vehicle) and DestroyedEvent for new code.

4. RespawnVehicle destroys the current vehicle first Calling RespawnVehicle while a player is still seated will eject them and destroy the existing cannon before the new one appears. Add a short Sleep after DestroyVehicle if you want the destruction VFX to play before the respawn.

5. AssignDriver requires the vehicle to exist If you call AssignDriver before the cannon has spawned (or after DestroyVehicle and before RespawnVehicle completes), nothing happens. Subscribe to SpawnedEvent to know when it's safe to seat a player.

6. @editable is mandatory You cannot construct a vehicle_spawner_cannon_device{} in code and expect it to control a placed device. The field must be declared @editable and assigned in the Details panel to the actual placed device in the level.

7. spawn {} for async work inside event handlers Event handler callbacks are not <suspends>, so you cannot call Sleep directly inside them. Use spawn { MyAsyncFunction() } to kick off any timed logic from within a handler.

Device Settings & Options

The vehicle_spawner_cannon_device User Options panel in the UEFN editor — every setting you can tune.

Vehicle Spawner Cannon Device settings and options panel in the UEFN editor — Supports Wraps
Vehicle Spawner Cannon Device — User Options in the UEFN editor: Supports Wraps
⚙️ Settings on this device (1)

Setting names read from the panel above — may be partial; the screenshots are the source of truth.

Supports Wraps

Build your own lesson with vehicle_spawner_cannon_device

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 →