Reference Devices compiles

vehicle_spawner_taxi_device: Scripted Taxi Rides for Your Island

The `vehicle_spawner_taxi_device` lets you place a drivable taxi on your island and control every moment of its life cycle from Verse: spawn it, assign a player as driver, listen for passengers boarding or exiting, and destroy or respawn it on demand. Whether you're building a city-map transport system, a timed getaway mission, or a cinematic taxi arrival sequence, this device is your entry point. It inherits all of its power from `vehicle_spawner_device`, so every pattern here applies to the fu

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

Overview

The vehicle_spawner_taxi_device is a specialized vehicle_spawner_device that spawns a taxi cab on your island. Drop one into your UEFN level, wire it to Verse, and you gain full programmatic control:

  • Spawn / respawn the taxi at any time with RespawnVehicle.
  • Assign a driver automatically with AssignDriver, so a player is instantly placed in the driver's seat.
  • React to passengers entering or leaving via AgentEntersVehicleEvent and AgentExitsVehicleEvent.
  • Destroy the taxi on cue (mission complete, time expired, etc.) with DestroyVehicle.
  • Enable / disable the spawner so it only produces a vehicle when your game logic is ready.
  • Inspect the spawned vehicle through SpawnedEvent, which delivers the live fort_vehicle reference you can query for fuel, speed, and occupants.

When to reach for it: Any time you want a taxi that responds to game state — a player calls a cab, the cab arrives, the player rides, and the cab disappears after the fare. It's also the right tool when you need to force-respawn a destroyed vehicle or programmatically seat a player without them having to walk up and press a button.

API Reference

vehicle_spawner_taxi_device

Specialized vehicle_spawner_device that allows a taxi 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_taxi_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: The Getaway Cab

A player activates a button to call a taxi. The taxi spawns, the player is automatically seated as driver, a countdown timer starts, and if the player exits before reaching the destination the taxi is destroyed and must be re-called. We also log when the taxi itself is destroyed so we can re-enable the button.

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

# Place this device in your level alongside a vehicle_spawner_taxi_device and a button_device.
getaway_cab_manager := class(creative_device):

    # Wire this to your Vehicle Spawner Taxi device in the UEFN details panel.
    @editable
    TaxiSpawner : vehicle_spawner_taxi_device = vehicle_spawner_taxi_device{}

    # Wire this to a Button device the player interacts with to "call the cab".
    @editable
    CallButton : button_device = button_device{}

    # Tracks whether a cab is currently active so we don't double-spawn.
    var CabActive : logic = false

    OnBegin<override>()<suspends> : void =
        # Start with the spawner disabled — no taxi on the map yet.
        TaxiSpawner.Disable()

        # Subscribe to the button so a player can call the cab.
        CallButton.InteractedWithEvent.Subscribe(OnCabCalled)

        # Subscribe to vehicle lifecycle events.
        TaxiSpawner.AgentEntersVehicleEvent.Subscribe(OnAgentEnters)
        TaxiSpawner.AgentExitsVehicleEvent.Subscribe(OnAgentExits)
        TaxiSpawner.SpawnedEvent.Subscribe(OnTaxiSpawned)
        TaxiSpawner.DestroyedEvent.Subscribe(OnTaxiDestroyed)

    # Called when a player presses the "Call Cab" button.
    OnCabCalled(Agent : agent) : void =
        if (not CabActive?):
            set CabActive = true
            # Enable the spawner, then respawn so a fresh taxi appears.
            TaxiSpawner.Enable()
            TaxiSpawner.RespawnVehicle()
            # Immediately assign this player as the driver.
            TaxiSpawner.AssignDriver(Agent)

    # SpawnedEvent delivers the live fort_vehicle — inspect it here.
    OnTaxiSpawned(Vehicle : fort_vehicle) : void =
        # We could query Vehicle.GetFuelRemaining() or Vehicle.Speed here.
        # For this example we just confirm the taxi is live.
        Print("Taxi spawned and ready.")

    # Fires whenever ANY agent boards the taxi.
    OnAgentEnters(Agent : agent) : void =
        Print("Agent boarded the taxi.")

    # Fires when an agent leaves the taxi mid-ride — destroy it as a penalty.
    OnAgentExits(Agent : agent) : void =
        if (CabActive?):
            # Player bailed — destroy the cab.
            TaxiSpawner.DestroyVehicle()

    # DestroyedEvent fires after the vehicle is gone.
    OnTaxiDestroyed(Unused : tuple()) : void =
        set CabActive = false
        # Disable the spawner until the player calls again.
        TaxiSpawner.Disable()
        Print("Taxi destroyed. Press the button to call a new one.")

Line-by-line highlights:

Line / block What it teaches
TaxiSpawner.Disable() in OnBegin The taxi won't appear at round start — only when the player earns it.
TaxiSpawner.Enable() + RespawnVehicle() Enable first, then spawn. Calling RespawnVehicle on a disabled spawner has no effect.
TaxiSpawner.AssignDriver(Agent) Seats the calling player instantly — no walking required.
SpawnedEvent.Subscribe(OnTaxiSpawned) Uses the modern, non-deprecated event that delivers the fort_vehicle reference.
DestroyedEvent.Subscribe(OnTaxiDestroyed) Handler receives tuple() — ignore the payload with Unused.
AgentExitsVehicleEventDestroyVehicle() Demonstrates chaining events to methods for reactive game logic.

Common Patterns

Pattern 1 — Periodic Respawn (Taxi Rank)

Destroy and respawn the taxi on a fixed timer so a fresh cab always appears at the rank, even if the previous one was wrecked.

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

taxi_rank_manager := class(creative_device):

    @editable
    TaxiSpawner : vehicle_spawner_taxi_device = vehicle_spawner_taxi_device{}

    # Respawn interval in seconds.
    @editable
    RespawnIntervalSeconds : float = 30.0

    OnBegin<override>()<suspends> : void =
        TaxiSpawner.Enable()
        TaxiSpawner.RespawnVehicle()
        # Loop forever, refreshing the taxi every interval.
        loop:
            Sleep(RespawnIntervalSeconds)
            # RespawnVehicle destroys the old taxi first, then spawns a new one.
            TaxiSpawner.RespawnVehicle()
            Print("Taxi rank refreshed.")

Key point: RespawnVehicle() is safe to call even when a taxi is already present — it destroys the existing one first, so you never end up with duplicates.


Pattern 2 — Inspect the Spawned Vehicle with SpawnedEvent

Use the fort_vehicle delivered by SpawnedEvent to read fuel and occupants immediately after spawn.

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

taxi_inspector := class(creative_device):

    @editable
    TaxiSpawner : vehicle_spawner_taxi_device = vehicle_spawner_taxi_device{}

    OnBegin<override>()<suspends> : void =
        TaxiSpawner.SpawnedEvent.Subscribe(OnTaxiSpawned)
        TaxiSpawner.Enable()
        TaxiSpawner.RespawnVehicle()

    OnTaxiSpawned(Vehicle : fort_vehicle) : void =
        # Read fuel — returns -1.0 if the vehicle doesn't use fuel.
        Fuel := Vehicle.GetFuelRemaining()
        Capacity := Vehicle.GetFuelCapacity()
        # Read current occupants (should be empty right after spawn).
        Occupants := Vehicle.GetOccupants()
        Print("Taxi spawned. Fuel: {Fuel}/{Capacity}. Occupants: {Occupants.Length}")

Key point: SpawnedEvent is the only way to get a live fort_vehicle reference from the spawner. Store it in a var field if you need it later (e.g., to call TeleportTo).


Pattern 3 — Auto-Assign Driver on Entry

Some designs want ANY player who enters the taxi to be promoted to driver automatically (e.g., a first-come-first-served cab).

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

auto_driver_assigner := class(creative_device):

    @editable
    TaxiSpawner : vehicle_spawner_taxi_device = vehicle_spawner_taxi_device{}

    # Track whether a driver has been assigned this round.
    var DriverAssigned : logic = false

    OnBegin<override>()<suspends> : void =
        TaxiSpawner.AgentEntersVehicleEvent.Subscribe(OnAgentEnters)
        TaxiSpawner.AgentExitsVehicleEvent.Subscribe(OnAgentExits)
        TaxiSpawner.Enable()
        TaxiSpawner.RespawnVehicle()

    OnAgentEnters(Agent : agent) : void =
        if (not DriverAssigned?):
            # First player in becomes the driver.
            TaxiSpawner.AssignDriver(Agent)
            set DriverAssigned = true
            Print("Driver assigned.")

    OnAgentExits(Agent : agent) : void =
        # Reset so the next entrant can become driver.
        set DriverAssigned = false
        Print("Driver exited — seat open.")

Key point: AgentEntersVehicleEvent fires for every occupant (driver and passengers). Guard with a flag so only the first entrant gets AssignDriver called.


Gotchas

1. Enable before RespawnVehicle

Calling RespawnVehicle() on a disabled spawner does nothing. Always call TaxiSpawner.Enable() first, then TaxiSpawner.RespawnVehicle(). If your taxi never appears, this is the first thing to check.

2. DestroyedEvent delivers tuple(), not an agent

DestroyedEvent and the deprecated VehicleDestroyedEvent both send tuple() — an empty payload. Your handler signature must be (Unused : tuple()) : void. There is no agent or vehicle reference in this event; if you need the vehicle, capture it from SpawnedEvent into a class-level var.

3. AgentEntersVehicleEvent fires for all seats

This event fires for the driver and every passenger. If your logic should only run for the driver, check Vehicle.GetDrivers() inside the handler (you'll need the fort_vehicle reference from SpawnedEvent).

4. SpawnedEvent vs. VehicleSpawnedEvent

VehicleSpawnedEvent is deprecated and delivers tuple() — you get no vehicle reference. Always use SpawnedEvent, which delivers the live fort_vehicle you can actually query.

5. AssignDriver requires the vehicle to already exist

If you call AssignDriver before RespawnVehicle completes (or before the spawner has a vehicle), the call is silently ignored. Subscribe to SpawnedEvent and call AssignDriver from that handler, or add a short Sleep after RespawnVehicle to let the spawn complete.

6. The device must be an @editable field

You cannot write vehicle_spawner_taxi_device{}.RespawnVehicle() — that creates a dummy object with no connection to the placed device. Declare @editable TaxiSpawner : vehicle_spawner_taxi_device = vehicle_spawner_taxi_device{} and wire it in the UEFN details panel.

7. No using lines in your snippet? Add them.

The compiler needs using { /Fortnite.com/Devices } to resolve vehicle_spawner_taxi_device and using { /Fortnite.com/Vehicles } to resolve fort_vehicle. Missing imports produce Unknown identifier errors that look unrelated to the actual problem.

Guides & scripts that use vehicle_spawner_taxi_device

Step-by-step tutorials that put this object to work.

Build your own lesson with vehicle_spawner_taxi_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 →