Reference Devices compiles

distortion_effect_device: Warp Your Audio on Demand

The `distortion_effect_device` is a Patchwork audio processor that applies a distortion effect to any audio signal routed through it. From Verse you can switch it on or off at runtime, letting you react to game events — a boss arriving, a player entering a danger zone, a round reaching its climax — by warping the music to match the mood.

Updated Examples verified on the live UEFN compiler

Overview

The distortion_effect_device lives in the Patchwork audio system, a node-based music toolkit built into UEFN. You place it in your level, wire an audio source into it, and then control whether the distortion is active from Verse using two simple methods: Enable and Disable.

Reach for this device when you want your game's music or sound design to react dynamically to gameplay state — for example:

  • Boss encounter: Crank on distortion the moment a boss spawns, restore clean audio when it dies.
  • Danger zone: Distort the ambient track while a player is inside a hazard volume.
  • Countdown climax: Enable distortion in the final 10 seconds of a round to build tension.

Because the device is part of patchwork_device, it integrates naturally with other Patchwork nodes (sequencers, instrument players, echo effects) and is toggled entirely from code — no manual button-pressing required.

API Reference

distortion_effect_device

Apply a distortion effect to Patchwork audio inputs.

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

distortion_effect_device<public> := class<concrete><final>(patchwork_device):

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.

Walkthrough

Scenario: A trigger plate marks the entrance to a boss arena. When a player steps on it, the background music distorts to signal danger. When the player steps off a second plate (the exit), the distortion is removed and the music returns to normal.

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

# Place this Verse device in your level alongside:
#   - An EnterPlate  (trigger_device) at the arena entrance
#   - An ExitPlate   (trigger_device) at the arena exit
#   - A Distortion   (distortion_effect_device) wired into your Patchwork chain
boss_arena_audio_manager := class(creative_device):

    # Wire these in the UEFN Details panel
    @editable
    EnterPlate : trigger_device = trigger_device{}

    @editable
    ExitPlate : trigger_device = trigger_device{}

    @editable
    Distortion : distortion_effect_device = distortion_effect_device{}

    # Called when the level starts
    OnBegin<override>()<suspends> : void =
        # Start with clean audio — distortion off
        Distortion.Disable()

        # Subscribe to both plates
        EnterPlate.TriggeredEvent.Subscribe(OnPlayerEnterArena)
        ExitPlate.TriggeredEvent.Subscribe(OnPlayerExitArena)

    # Handler: player steps onto the entrance plate
    OnPlayerEnterArena(Agent : ?agent) : void =
        # Enable distortion to signal the boss zone
        Distortion.Enable()

    # Handler: player steps onto the exit plate
    OnPlayerExitArena(Agent : ?agent) : void =
        # Disable distortion — back to clean audio
        Distortion.Disable()

Line-by-line explanation:

Lines What's happening
@editable fields Expose the two trigger plates and the distortion device so you can wire them in the UEFN Details panel without touching code.
OnBegin Runs once at level start. Calls Distortion.Disable() so the game always starts with clean audio regardless of the device's default state in the editor. Then subscribes both plates.
EnterPlate.TriggeredEvent.Subscribe(...) Registers OnPlayerEnterArena as the callback. TriggeredEvent sends a ?agent, so the handler signature must accept (Agent : ?agent).
Distortion.Enable() Activates the distortion effect in the Patchwork signal chain immediately.
Distortion.Disable() Deactivates it, restoring the unprocessed audio signal.

UEFN setup: In the Patchwork editor, route your instrument or audio player's output through the distortion_effect_device node before it reaches the output. Place the Verse device actor in the Outliner and assign all three @editable references in its Details panel.

Common patterns

Pattern 1 — Toggle distortion on a timer (timed danger pulse)

Enable distortion for exactly 5 seconds, then automatically disable it — useful for a brief audio sting when a hazard activates.

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

hazard_audio_pulse := class(creative_device):

    @editable
    HazardTrigger : trigger_device = trigger_device{}

    @editable
    Distortion : distortion_effect_device = distortion_effect_device{}

    OnBegin<override>()<suspends> : void =
        Distortion.Disable()
        HazardTrigger.TriggeredEvent.Subscribe(OnHazardActivated)

    OnHazardActivated(Agent : ?agent) : void =
        # Fire-and-forget: run the timed pulse concurrently
        spawn { TimedDistortionPulse() }

    TimedDistortionPulse()<suspends> : void =
        Distortion.Enable()
        # Hold distortion active for 5 seconds
        Sleep(5.0)
        Distortion.Disable()

Key point: Sleep requires a <suspends> context, so the pulse runs in its own async task via spawn { }. Enable and Disable themselves are plain void — no effects needed to call them.


Pattern 2 — Enable distortion at round start, disable at round end

Wire into a round_settings_device or a pair of button devices to bracket an entire round with distorted audio.

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

round_distortion_controller := class(creative_device):

    @editable
    StartButton : button_device = button_device{}

    @editable
    EndButton : button_device = button_device{}

    @editable
    Distortion : distortion_effect_device = distortion_effect_device{}

    OnBegin<override>()<suspends> : void =
        Distortion.Disable()
        StartButton.InteractedWithEvent.Subscribe(OnRoundStart)
        EndButton.InteractedWithEvent.Subscribe(OnRoundEnd)

    # button_device sends agent (not ?agent) on InteractedWithEvent
    OnRoundStart(Agent : agent) : void =
        Distortion.Enable()

    OnRoundEnd(Agent : agent) : void =
        Distortion.Disable()

Key point: button_device.InteractedWithEvent delivers a non-optional agent, not ?agent — no unwrapping needed here, unlike trigger_device.TriggeredEvent.

Gotchas

1. distortion_effect_device is a patchwork_device, not a creative_device_base

You must import using { /Fortnite.com/Devices/Patchwork } or the type won't resolve. A missing import shows as Unknown identifier: distortion_effect_device.

2. The device must be wired in Patchwork to have any audible effect

Enable() and Disable() toggle the device's processing state, but if nothing is routed through it in the Patchwork node graph, you'll hear no difference. Always verify the signal chain in the Patchwork editor before testing in Verse.

3. Default state matters — always set it explicitly in OnBegin

The device's default enabled/disabled state is set in the UEFN editor. If you rely on that default and a designer changes it, your game logic breaks. Call Distortion.Disable() (or Enable()) at the top of OnBegin to own the initial state from code.

4. trigger_device.TriggeredEvent sends ?agent, not agent

If you subscribe a handler to TriggeredEvent, its parameter must be (Agent : ?agent). If you need to act on the specific player, unwrap it: if (A := Agent?) { ... }. Forgetting the ? causes a compile error.

5. Enable and Disable have no effects — they're safe to call anywhere

Neither method is marked <suspends>, <transacts>, or <decides>, so you can call them from any context: synchronous handlers, async tasks, or nested functions — no special wrapping required.

Guides & scripts that use distortion_effect_device

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

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