Overview
The Patchwork system in UEFN is a collection of music devices — speakers, instrument players, drum sequencers, synthesizers, effects, and modulators — that you connect together to produce a dynamic in-game soundtrack. Every one of these devices inherits from the base class patchwork_device, which is the type this article documents.
patchwork_device itself exposes just two methods: Enable() and Disable(). That sounds minimal, but it is exactly the hook you need to make music react to gameplay. Instead of a static loop that plays forever, you can:
- Start a tense synth layer only when the boss spawns.
- Mute the drums when the last player is eliminated.
- Toggle an echo effect on a speaker when a player enters a cave.
- Bring instruments online one at a time as a round ramps up.
Because Enable/Disable live on the shared base class, the same code works for a speaker_device, a drum_sequencer_device, an instrument_player_device, a distortion_effect_device, and any other Patchwork device. Reach for this whenever you want music that responds to the game state rather than a fixed background track.
API Reference
patchwork_device
Base class for all Patchwork devices.
Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).
patchwork_device<public> := class<concrete>(creative_device_base):
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
Let's build a concrete scenario. A player steps on a pressure plate at the entrance of a boss arena. When they do, we enable a drum sequencer and an instrument player to kick the combat music in. When the boss room is cleared (the player steps on an exit plate), we disable those devices to return to calm.
We'll use two trigger_devices for the plates and two Patchwork devices for the music layers. All four are @editable fields, so you drop the matching devices in your level and assign them in the Details panel.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices/Patchwork }
# Music that turns on when combat starts and off when it ends.
boss_music_director := class(creative_device):
# The pressure plate at the arena entrance.
@editable
CombatStartPlate : trigger_device = trigger_device{}
# The pressure plate at the arena exit.
@editable
CombatEndPlate : trigger_device = trigger_device{}
# The drum loop layer (a Patchwork drum sequencer).
@editable
DrumLayer : drum_sequencer_device = drum_sequencer_device{}
# The melody layer (a Patchwork instrument player).
@editable
MelodyLayer : instrument_player_device = instrument_player_device{}
OnBegin<override>()<suspends> : void =
# Start with combat music silent.
DrumLayer.Disable()
MelodyLayer.Disable()
# React to the plates.
CombatStartPlate.TriggeredEvent.Subscribe(OnCombatStart)
CombatEndPlate.TriggeredEvent.Subscribe(OnCombatEnd)
# Player stepped on the entrance plate: layer the music in.
OnCombatStart(Agent : ?agent) : void =
DrumLayer.Enable()
MelodyLayer.Enable()
# Player stepped on the exit plate: fade the combat layers out.
OnCombatEnd(Agent : ?agent) : void =
DrumLayer.Disable()
MelodyLayer.Disable()
Line by line:
- The
using { /Fortnite.com/Devices/Patchwork }directive is what makesdrum_sequencer_deviceandinstrument_player_deviceresolve — they live in thePatchworkmodule. Without it you get Unknown identifier. - Each
@editablefield is a placed device.DrumLayerandMelodyLayerare concrete Patchwork devices that inheritEnable/Disablefrompatchwork_device. - In
OnBegin, we callDrumLayer.Disable()andMelodyLayer.Disable()immediately so the combat music doesn't play at round start. CombatStartPlate.TriggeredEvent.Subscribe(OnCombatStart)wires the entrance plate to our handler.TriggeredEventis alistenable(?agent), so the handler signature is(Agent : ?agent).OnCombatStartcallsEnable()on both layers — the drums and melody come alive.OnCombatEnddoes the reverse withDisable(), returning the arena to silence.
Notice we never call Print to "make music play" — the actual sound comes from calling the device's real Enable/Disable methods.
Common patterns
Toggle a single speaker for an ambient zone
Use one trigger_device to flip a speaker on, another to flip it off — perfect for a cave or interior that has its own atmosphere.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices/Patchwork }
ambient_zone := class(creative_device):
@editable
EnterZone : trigger_device = trigger_device{}
@editable
ExitZone : trigger_device = trigger_device{}
# A Patchwork speaker that outputs the zone's ambience.
@editable
ZoneSpeaker : speaker_device = speaker_device{}
OnBegin<override>()<suspends> : void =
ZoneSpeaker.Disable()
EnterZone.TriggeredEvent.Subscribe(OnEnter)
ExitZone.TriggeredEvent.Subscribe(OnExit)
OnEnter(Agent : ?agent) : void =
ZoneSpeaker.Enable()
OnExit(Agent : ?agent) : void =
ZoneSpeaker.Disable()
Punch in an effect on a button press
Wrap a distortion_effect_device so a button toggles a gritty distortion on the audio chain — great for a "power surge" moment.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices/Patchwork }
distortion_toggle := class(creative_device):
@editable
SurgeButton : button_device = button_device{}
@editable
Distortion : distortion_effect_device = distortion_effect_device{}
# Track whether the effect is currently on.
var IsOn : logic = false
OnBegin<override>()<suspends> : void =
Distortion.Disable()
SurgeButton.InteractedWithEvent.Subscribe(OnPressed)
OnPressed(Agent : agent) : void =
if (IsOn?):
Distortion.Disable()
set IsOn = false
else:
Distortion.Enable()
set IsOn = true
Layer in a synth when the boss spawns
Drive Patchwork from a non-plate event source — here a trigger_device representing the boss spawn signal enables an omega_synthesizer_device.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices/Patchwork }
boss_synth_layer := class(creative_device):
@editable
BossSpawnSignal : trigger_device = trigger_device{}
# A Patchwork synth that adds tension during the boss fight.
@editable
SynthLayer : omega_synthesizer_device = omega_synthesizer_device{}
OnBegin<override>()<suspends> : void =
SynthLayer.Disable()
BossSpawnSignal.TriggeredEvent.Subscribe(OnBossSpawned)
OnBossSpawned(Agent : ?agent) : void =
SynthLayer.Enable()
Gotchas
- Import the Patchwork module. All the concrete devices (
speaker_device,drum_sequencer_device,instrument_player_device,distortion_effect_device,omega_synthesizer_device, …) live in/Fortnite.com/Devices/Patchwork. Forgetting thatusingline gives Unknown identifier on the type, not onEnable. patchwork_deviceis the base class, not a placeable on its own list — you assign the concrete subclass. Declare your@editableas the specific subclass you placed (e.g.speaker_device), but you can still call the inheritedEnable/Disableon it.Enable/Disablehave no agent. Unlike many device methods, these take no parameters — they affect the device globally, not per-player. There is no "enable for this player" variant.- Disable in
OnBeginif you want silence at start. Patchwork devices may begin enabled depending on their editor settings. If your design expects the layer to be off until triggered, callDisable()inOnBeginto be explicit. - Unwrap the optional agent before using it. Event handlers for
TriggeredEventreceive(Agent : ?agent). If you actually need the player, unwrap withif (A := Agent?):. In the examples above we ignore the agent because Enable/Disable don't need it — that's fine and compiles. - A modulator outputs 0 when disabled (historically). If you wire a modulator into another device and
Disable()it, be aware of how its output value is interpreted by the target — test the audible result rather than assuming silence.