Reference Devices compiles

nitro_barrel_spawner_device: Explosive Environmental Hazards

The `nitro_barrel_spawner_device` drops a volatile nitro barrel into your level that players can launch — and when it explodes, everyone nearby gets a Nitro boost. Whether you're building a chaotic party game, a timed hazard arena, or a skill-based obstacle course, this device gives you runtime control over barrel force, respawn behavior, and event-driven reactions to launches and explosions.

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

Overview

The nitro_barrel_spawner_device spawns a physical nitro barrel prop in your level. When a player interacts with it, the barrel is launched into the air; when it lands and explodes, it applies the Nitro effect (a speed/jump boost) to nearby players.

You reach for this device when you want:

  • Environmental hazards — barrels that reward or punish players who trigger them.
  • Timed chaos — enable/disable barrels on a schedule to control when danger appears.
  • Skill-based arenas — tune launch force so barrels fly farther or shorter depending on game phase.
  • Event-driven scoring — react to who launched or exploded a barrel to award points or trigger other devices.

The device exposes two events (LaunchedEvent, ExplodedEvent) and a full set of methods to toggle the barrel, tune its physics, and control whether it respawns after exploding.

API Reference

nitro_barrel_spawner_device

Used to create an environmental prop that applies Nitro to those around it when it is destroyed.

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

nitro_barrel_spawner_device<public> := class<concrete><final>(creative_device_base):

Events (subscribe a handler to react):

Event Signature Description
LaunchedEvent LaunchedEvent<public>:listenable(?agent) Triggers when an agent launches the barrel. Sends the launching agent.If the launcher is a non-agent, sends false.
ExplodedEvent ExplodedEvent<public>:listenable(?agent) Triggers when the barrel explodes after being launched. Sends the launching agent.If the launcher is a non-agent, sends false.

Methods (call these to make the device act):

Method Signature Description
Enable Enable<public>():void Enables and shows the barrel.Enabling the device when it's disabled will spawn a new barrel.
Disable Disable<public>():void Disables and hides the barrel.Disabling the device will remove an existing barrel and reset the respawn delay.
IsEnabled IsEnabled<public>()<transacts><decides>:void Succeeds if the barrel is enabled and visible.
SetLaunchForceMultiplier SetLaunchForceMultiplier<public>(LaunchForceMultiplier:float):void Sets the multiplier applied to the force used when launching.This is clamped between 0.25 and 2.0.
GetLaunchForceMultiplier GetLaunchForceMultiplier<public>():float Returns the force multiplier to launch the barrel.
AllowRespawn AllowRespawn<public>():void Allows the barrel to respawn after it explodes, waiting RespawnDelay seconds.
DisallowRespawn DisallowRespawn<public>():void Prevents the barrel from respawning.The RespawnDelay countdown will not start. If the countdown has already started, the barrel will not respawn when it ends.
IsRespawnAllowed IsRespawnAllowed<public>()<transacts><decides>:void Succeeds if the barrel has respawn allowed.
SetRespawnDelay SetRespawnDelay<public>(RespawnDelay:float):void Sets the delay time to respawn the barrel, clamped between 0.0 and 1000.0 seconds.This will override the delay timer if set during the delay countdown.
GetRespawnDelay GetRespawnDelay<public>():float Returns the delay between exploding and respawning (if allowed), in seconds.

Walkthrough

Scenario: The Nitro Gauntlet

You're building a gauntlet arena. When the round starts, three nitro barrels activate. Each time a barrel explodes, the game logs who triggered it and temporarily increases the launch force of the next barrel — making the arena progressively more dangerous. After 3 explosions the barrels are disabled and the round ends.

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

nitro_gauntlet_manager := class(creative_device):

    # Wire up to three Nitro Barrel Spawner devices in the Details panel
    @editable
    Barrel1 : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    @editable
    Barrel2 : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    @editable
    Barrel3 : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    # Track how many explosions have occurred this round
    var ExplosionCount : int = 0

    OnBegin<override>()<suspends> : void =
        # Configure all barrels: allow respawn with a 5-second delay
        for (Barrel : array{Barrel1, Barrel2, Barrel3}):
            Barrel.AllowRespawn()
            Barrel.SetRespawnDelay(5.0)
            Barrel.SetLaunchForceMultiplier(1.0)
            Barrel.Enable()

        # Subscribe to ExplodedEvent on all three barrels
        Barrel1.ExplodedEvent.Subscribe(OnBarrelExploded)
        Barrel2.ExplodedEvent.Subscribe(OnBarrelExploded)
        Barrel3.ExplodedEvent.Subscribe(OnBarrelExploded)

        # Subscribe to LaunchedEvent to react when a barrel is kicked
        Barrel1.LaunchedEvent.Subscribe(OnBarrelLaunched)
        Barrel2.LaunchedEvent.Subscribe(OnBarrelLaunched)
        Barrel3.LaunchedEvent.Subscribe(OnBarrelLaunched)

    # Called when any barrel is launched — ?agent is the launcher (or false for non-agents)
    OnBarrelLaunched(Agent : ?agent) : void =
        if (A := Agent?):
            Print("Barrel launched by a player!")
        else:
            Print("Barrel launched by a non-agent source.")

    # Called when any barrel explodes
    OnBarrelExploded(Agent : ?agent) : void =
        set ExplosionCount += 1

        if (A := Agent?):
            Print("Barrel exploded! Triggered by a player.")
        else:
            Print("Barrel exploded by a non-agent.")

        if (ExplosionCount >= 3):
            # Round over — disable all barrels
            Barrel1.Disable()
            Barrel2.Disable()
            Barrel3.Disable()
            Print("Gauntlet complete! All barrels disabled.")
        else:
            # Escalate: increase launch force on remaining barrels
            NewForce : float = 1.0 + (0.5 * ExplosionCount)
            Barrel1.SetLaunchForceMultiplier(NewForce)
            Barrel2.SetLaunchForceMultiplier(NewForce)
            Barrel3.SetLaunchForceMultiplier(NewForce)
            Print("Force escalated!")

Line-by-line breakdown:

Lines What's happening
@editable fields Three barrels wired in the Details panel — this is the only way to reference placed devices.
var ExplosionCount Mutable counter to track round progress.
AllowRespawn() / SetRespawnDelay(5.0) Barrels will reappear 5 seconds after exploding.
SetLaunchForceMultiplier(1.0) Start at default force (valid range: 0.25–2.0).
Enable() Spawns each barrel into the world at round start.
.ExplodedEvent.Subscribe(OnBarrelExploded) Registers the handler — fires every time any barrel explodes.
OnBarrelLaunched(Agent : ?agent) The event sends ?agent; unwrap with if (A := Agent?) before using the agent.
NewForce := 1.0 + (0.5 * ExplosionCount) Escalates force each explosion (caps at 2.0 internally).
Barrel1.Disable() Hides the barrel and cancels any pending respawn countdown.

Common patterns

Pattern 1 — Toggle a barrel on/off with IsEnabled check

A button in your level toggles a single nitro barrel. Before enabling, check whether it's already active to avoid double-spawning.

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

barrel_toggle_device := class(creative_device):

    @editable
    HazardBarrel : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    @editable
    ToggleButton : button_device = button_device{}

    OnBegin<override>()<suspends> : void =
        ToggleButton.InteractedWithEvent.Subscribe(OnButtonPressed)

    OnButtonPressed(Agent : agent) : void =
        # IsEnabled is a <decides> function — use it inside an `if`
        if (HazardBarrel.IsEnabled[]):
            HazardBarrel.Disable()
            Print("Barrel hidden.")
        else:
            HazardBarrel.Enable()
            Print("Barrel spawned!")

Note: IsEnabled is <transacts><decides>, so you call it with [] inside an if expression — it either succeeds (barrel is on) or fails (barrel is off).


Pattern 2 — Dynamic respawn control based on game phase

During the "safe phase" barrels don't respawn. When the danger phase starts, respawn is enabled with a short delay and force is cranked up.

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

phase_barrel_controller := class(creative_device):

    @editable
    PhaseBarrel : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    @editable
    PhaseTimer : timer_device = timer_device{}

    OnBegin<override>()<suspends> : void =
        # Safe phase: barrel is present but won't respawn after exploding
        PhaseBarrel.Enable()
        PhaseBarrel.DisallowRespawn()
        PhaseBarrel.SetLaunchForceMultiplier(0.5)

        Print("Safe phase: barrel force = {PhaseBarrel.GetLaunchForceMultiplier()}")
        Print("Respawn allowed: false")

        # When the timer ends, switch to danger phase
        PhaseTimer.SuccessEvent.Subscribe(OnDangerPhaseStart)

    OnDangerPhaseStart(Agent : agent) : void =
        # Danger phase: barrel respawns quickly and launches hard
        PhaseBarrel.AllowRespawn()
        PhaseBarrel.SetRespawnDelay(3.0)
        PhaseBarrel.SetLaunchForceMultiplier(2.0)

        Print("Danger phase! Respawn delay = {PhaseBarrel.GetRespawnDelay()}s")
        Print("Launch force = {PhaseBarrel.GetLaunchForceMultiplier()}")

        # Check respawn state with IsRespawnAllowed (also <decides>)
        if (PhaseBarrel.IsRespawnAllowed[]):
            Print("Confirmed: respawn is now active.")

Pattern 3 — Reward the launcher, punish bystanders

Subscribe to both events independently. When the barrel is launched, give the launcher a score bonus. When it explodes, disable the barrel for a penalty window before re-enabling.

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

barrel_reward_device := class(creative_device):

    @editable
    RewardBarrel : nitro_barrel_spawner_device = nitro_barrel_spawner_device{}

    @editable
    ScoreManager : score_manager_device = score_manager_device{}

    OnBegin<override>()<suspends> : void =
        RewardBarrel.Enable()
        RewardBarrel.AllowRespawn()
        RewardBarrel.SetRespawnDelay(8.0)
        RewardBarrel.SetLaunchForceMultiplier(1.5)

        RewardBarrel.LaunchedEvent.Subscribe(OnLaunched)
        RewardBarrel.ExplodedEvent.Subscribe(OnExploded)

    # Award points to the player who kicked the barrel
    OnLaunched(Agent : ?agent) : void =
        if (A := Agent?):
            ScoreManager.Activate(A)
            Print("Score awarded to launcher!")

    # After explosion, briefly disable then re-enable
    OnExploded(Agent : ?agent) : void =
        spawn { PenaltyWindow() }

    PenaltyWindow()<suspends> : void =
        # Disable overrides the respawn countdown
        RewardBarrel.Disable()
        Print("Barrel offline for penalty window...")
        Sleep(10.0)
        RewardBarrel.Enable()
        Print("Barrel back online!")

Gotchas

1. ?agent events — always unwrap before use

Both LaunchedEvent and ExplodedEvent send ?agent (an optional agent), not agent. The barrel can be triggered by non-agent sources (physics, other devices), in which case the value is false. Always unwrap:

# CORRECT
OnExploded(Agent : ?agent) : void =
    if (A := Agent?):
        # use A as a real agent here

# WRONG — Agent is ?agent, not agent; you can't pass it directly to APIs expecting agent

2. IsEnabled and IsRespawnAllowed are <decides> — use [] syntax

These methods don't return bool — they succeed or fail. Call them inside an if with the [] invocation syntax:

# CORRECT
if (MyBarrel.IsEnabled[]):
    MyBarrel.Disable()

# WRONG — IsEnabled() is not a bool-returning function

3. Disable() cancels the respawn countdown

Calling Disable() doesn't just hide the barrel — it resets the respawn delay timer. If you disable mid-countdown, the barrel will NOT respawn when the original timer would have fired. Use this intentionally for penalty windows (see Pattern 3), but don't call it accidentally if you want the respawn to proceed.

4. SetLaunchForceMultiplier is clamped to [0.25, 2.0]

Passing values outside this range won't error, but the engine silently clamps them. If your escalation math could exceed 2.0, cap it yourself:

ClampedForce : float = if (RawForce > 2.0) { 2.0 } else if (RawForce < 0.25) { 0.25 } else { RawForce }
MyBarrel.SetLaunchForceMultiplier(ClampedForce)

5. SetRespawnDelay is clamped to [0.0, 1000.0] and overrides a running timer

Calling SetRespawnDelay while the countdown is already running replaces the remaining time with the new value. This is powerful for dynamic difficulty but can cause unexpected instant-respawns if you set it to 0.0 mid-countdown.

6. Every device reference MUST be @editable

You cannot construct a nitro_barrel_spawner_device{} and have it refer to a placed device. The @editable attribute is the only bridge between your Verse class and the device you placed in the UEFN level. Without it, your code compiles but operates on a dummy instance that does nothing.

Device Settings & Options

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

Nitro Barrel Spawner Device settings and options panel in the UEFN editor — Start Enabled, Should Respawn, Respawn Delay
Nitro Barrel Spawner Device — User Options (1 of 2) in the UEFN editor: Start Enabled, Should Respawn, Respawn Delay
Nitro Barrel Spawner Device settings and options panel in the UEFN editor — Start Enabled, Should Respawn, Respawn Delay
Nitro Barrel Spawner Device — User Options (2 of 2) in the UEFN editor: Start Enabled, Should Respawn, Respawn Delay
⚙️ Settings on this device (3)

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

Start Enabled
Should Respawn
Respawn Delay

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