Reference Devices

vehicle_spawner_heavy_turret_device: Anti-Vehicle Turrets on Demand

The heavy turret is your island's mounted anti-vehicle gun — perfect for a base-defense objective or a 'man the cannon' moment. With Verse you can spawn it, enable/disable it, force a driver into the gunner seat, react when players hop in or out, and respawn it when it's wrecked.

Updated
The code on this reference page is provided as-is and did not pass the latest compile check — treat the examples as a starting point and verify in your project.
Watch the Knotvehicle_spawner_heavy_turret_device in ~90 seconds.

Overview

The vehicle_spawner_heavy_turret_device is a specialized vehicle_spawner_device that places and controls a fixed anti-vehicle heavy turret on your island. It solves the classic objective-mode problem: you want a powerful mounted gun that defenders can climb into to repel incoming tanks and battle buses, but you want full script control over when it exists, who is allowed to use it, and what happens when it gets destroyed.

Reach for it when you need:

  • A defensive emplacement that only activates during a specific game phase (Enable / Disable).
  • Logic that fires the moment a player mounts or dismounts the gun (AgentEntersVehicleEvent / AgentExitsVehicleEvent).
  • A respawn loop so the turret comes back after it's blown up (DestroyedEvent + RespawnVehicle).
  • The ability to drop a chosen player straight into the gunner seat (AssignDriver).

Because it inherits everything from vehicle_spawner_device, the same events and methods shown here work on the tank, UFO, siege cannon, and other vehicle spawners too.

API Reference

vehicle_spawner_heavy_turret_device

Specialized vehicle_spawner_device that allows an anti-vehicle turret 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_heavy_turret_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

Let's build a base-defense turret station. A trigger (the "man the gun" button) assigns whichever player stepped on it as the turret's driver. We score the team when they mount up, log dismounts, and automatically respawn the turret a few seconds after it's destroyed so defense never stays down for long.

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

turret_station := class(creative_device):

    # The placed heavy turret spawner. Drag the device onto this field in the Details panel.
    @editable
    Turret : vehicle_spawner_heavy_turret_device = vehicle_spawner_heavy_turret_device{}

    # A trigger players step on to take control of the gun.
    @editable
    ManTheGunTrigger : trigger_device = trigger_device{}

    # How long (seconds) before a destroyed turret respawns.
    @editable
    RespawnDelay : float = 5.0

    OnBegin<override>()<suspends>:void =
        # Turn the turret on at match start so the gun is usable.
        Turret.Enable()

        # When a player steps on the trigger, put them in the gunner seat.
        ManTheGunTrigger.TriggeredEvent.Subscribe(OnManTheGun)

        # React to mount / dismount and to spawn / destroy lifecycle.
        Turret.AgentEntersVehicleEvent.Subscribe(OnEntered)
        Turret.AgentExitsVehicleEvent.Subscribe(OnExited)
        Turret.SpawnedEvent.Subscribe(OnSpawned)
        Turret.DestroyedEvent.Subscribe(OnDestroyed)

    # trigger_device hands us an ?agent — unwrap it before use.
    OnManTheGun(MaybeAgent : ?agent) : void =
        if (Agent := MaybeAgent?):
            # Force this player into the turret's gunner seat.
            Turret.AssignDriver(Agent)

    # AgentEntersVehicleEvent is listenable(agent) — handler takes a plain agent.
    OnEntered(Agent : agent) : void =
        Print("A defender has manned the heavy turret!")

    OnExited(Agent : agent) : void =
        Print("The turret gunner seat is now empty.")

    # SpawnedEvent sends the fort_vehicle that was spawned.
    OnSpawned(Vehicle : fort_vehicle) : void =
        Print("Heavy turret is online and ready.")

    # DestroyedEvent sends an empty tuple — start the respawn timer.
    OnDestroyed() : void =
        Print("Turret destroyed! Respawning soon.")
        spawn { RespawnAfterDelay() }

    RespawnAfterDelay()<suspends> : void =
        Sleep(RespawnDelay)
        # Spawns a fresh turret (any old one is destroyed first).
        Turret.RespawnVehicle()

Line by line:

  • The @editable fields are how Verse talks to a placed device. You must drag the real heavy turret spawner, trigger, etc. onto these slots in the Details panel — a bare vehicle_spawner_heavy_turret_device{} literal is just a placeholder until you bind it.
  • Turret.Enable() in OnBegin makes the gun usable from the start. Calling Disable() later would lock players out without removing the turret.
  • ManTheGunTrigger.TriggeredEvent.Subscribe(OnManTheGun) wires the step-on event to a method. Event handlers are ordinary methods at class scope.
  • The trigger's event is listenable(?agent), so OnManTheGun receives a ?agent. We unwrap with if (Agent := MaybeAgent?) before calling Turret.AssignDriver(Agent), which snaps that player into the gunner seat.
  • AgentEntersVehicleEvent and AgentExitsVehicleEvent are listenable(agent) (not optional), so those handlers take a plain agent directly.
  • SpawnedEvent sends a fort_vehicle, the actual spawned turret object — handy if you later want to query or affect the vehicle itself.
  • DestroyedEvent is listenable(tuple()), so the handler takes no useful payload — its signature is ():void. We spawn a suspending function so the Sleep doesn't block the event handler, then call RespawnVehicle() to bring the gun back.

Common patterns

Phase control: enable the turret only during the defense round

Disable the gun during build phase, then flip it on when combat starts so attackers can't pre-camp it.

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

turret_phase_control := class(creative_device):

    @editable
    Turret : vehicle_spawner_heavy_turret_device = vehicle_spawner_heavy_turret_device{}

    @editable
    CombatStartTrigger : trigger_device = trigger_device{}

    @editable
    CombatEndTrigger : trigger_device = trigger_device{}

    OnBegin<override>()<suspends>:void =
        # Locked down until combat begins.
        Turret.Disable()
        CombatStartTrigger.TriggeredEvent.Subscribe(OnCombatStart)
        CombatEndTrigger.TriggeredEvent.Subscribe(OnCombatEnd)

    OnCombatStart(MaybeAgent : ?agent) : void =
        Turret.Enable()
        # Make sure a turret is actually present for the fight.
        Turret.RespawnVehicle()

    OnCombatEnd(MaybeAgent : ?agent) : void =
        # Lock players out and remove the gun between rounds.
        Turret.Disable()
        Turret.DestroyVehicle()

Mount detection: lock a door while the gun is manned

Use the enter/exit events to drive other devices — here we keep a barrier closed while someone is gunning.

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

turret_manned_gate := class(creative_device):

    @editable
    Turret : vehicle_spawner_heavy_turret_device = vehicle_spawner_heavy_turret_device{}

    @editable
    DefenseBarrier : barrier_device = barrier_device{}

    OnBegin<override>()<suspends>:void =
        Turret.Enable()
        Turret.AgentEntersVehicleEvent.Subscribe(OnGunnerMounted)
        Turret.AgentExitsVehicleEvent.Subscribe(OnGunnerDismounted)

    OnGunnerMounted(Agent : agent) : void =
        # Seal the defense while the gun is occupied.
        DefenseBarrier.Enable()

    OnGunnerDismounted(Agent : agent) : void =
        # Open it back up when the gunner leaves.
        DefenseBarrier.Disable()

Cleanup on game end: destroy the turret

Tear the emplacement down when an end-game device fires.

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

turret_cleanup := class(creative_device):

    @editable
    Turret : vehicle_spawner_heavy_turret_device = vehicle_spawner_heavy_turret_device{}

    @editable
    RoundOverButton : button_device = button_device{}

    OnBegin<override>()<suspends>:void =
        Turret.Enable()
        RoundOverButton.InteractedWithEvent.Subscribe(OnRoundOver)

    OnRoundOver(Agent : agent) : void =
        # Remove the gun and stop new ones from being usable.
        Turret.DestroyVehicle()
        Turret.Disable()

Gotchas

  • Bind the @editable field. A device declared as vehicle_spawner_heavy_turret_device{} is just a placeholder. If you forget to drag the actual placed spawner onto the field in the Details panel, every method call quietly targets nothing. Always place the real device and assign it.
  • AgentEntersVehicleEvent is listenable(agent), the trigger's TriggeredEvent is listenable(?agent). Don't copy-paste the same handler signature. Vehicle enter/exit hand you a plain agent; the trigger hands you a ?agent you must unwrap with if (A := Maybe?).
  • DestroyedEvent / SpawnedEvent payloads differ. SpawnedEvent is listenable(fort_vehicle) so its handler takes a fort_vehicle. DestroyedEvent is listenable(tuple()) so its handler takes nothing — write it as OnDestroyed():void. Mismatched handler arity won't compile.
  • Prefer SpawnedEvent/DestroyedEvent over the deprecated pair. VehicleSpawnedEvent and VehicleDestroyedEvent still exist but are deprecated; use the new events which (for spawn) give you the actual fort_vehicle.
  • RespawnVehicle() destroys the old vehicle first. It's not additive — calling it doesn't stack turrets. If you want to remove the gun without making a new one, use DestroyVehicle().
  • Don't Sleep inside an event handler directly. Event handler methods aren't <suspends>. Use spawn { MySuspendingFunc() } to run a delayed respawn so you don't block.
  • Disable() doesn't remove the turret. It only stops players from using/spawning it. Pair it with DestroyVehicle() if you actually want the gun gone.

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