customizable_light_device: Lights That React to the Game
The customizable_light_device is a light source with no physical prop — pure, controllable illumination you can turn on, off, dim, or disable entirely from Verse. This article shows how to wire one up so it reacts to a button press, a puzzle solve, or any in-game signal.
customizable_light_device in ~90 seconds.Overview
The customizable_light_device is a light source you place in your level that has no associated prop — there's no street lamp or bulb mesh, just the light itself. That makes it perfect for atmospheric lighting you want to control programmatically: a vault that glows green when unlocked, a horror hallway that flickers off when a player crosses a trigger, or a puzzle where the right combination of lights must be lit.
Reach for it whenever you want light to be a piece of game state. Because it exposes simple verbs — TurnOn, TurnOff, Toggle, DimLight, UndimLight, plus Enable/Disable — you map game events straight onto those calls. You configure the color, brightness, and Dimming Amount in the device's Details panel in UEFN; Verse just tells it when to change.
A few mental notes before the code:
Enable/Disablecontrol whether the device responds at all. A disabled light won't react toTurnOn.TurnOn/TurnOff/Toggleflip the light's lit state.DimLight/UndimLightstep the brightness down/up by the Dimming Amount you set in the editor — call them repeatedly to fade across multiple steps.
API Reference
customizable_light_device
Used to create a light which can have its color and brightness manipulated in response to in-game events.
Full public surface, resolved verbatim from the live Epic digest (Fortnite.digest.verse).
customizable_light_device<public> := class<concrete><final>(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. |
TurnOn |
TurnOn<public>():void |
Turns on the light. |
TurnOff |
TurnOff<public>():void |
Turns off the light. |
Toggle |
Toggle<public>():void |
Toggles between TurnOn and TurnOff. |
DimLight |
DimLight<public>():void |
Dims the light by Dimming Amount. |
UndimLight |
UndimLight<public>():void |
Brightens the light by Dimming Amount. |
Walkthrough
Let's build a concrete scenario: a sealed treasure room. There's a button the player interacts with. The first press powers up (Enable) and turns on a bank of lights. Each subsequent press toggles the lights off and on like a switch. We'll also have an alarm trigger (a trigger plate) that, when stepped on, dims the lights to create a tense "power failure" effect.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# A treasure room whose lights react to a button and an alarm plate.
treasure_room_lights := class(creative_device):
# The light over the treasure. Drag your Customizable Light here in the Details panel.
@editable
TreasureLight : customizable_light_device = customizable_light_device{}
# The button players press to operate the lights.
@editable
LightButton : button_device = button_device{}
# A trigger plate that triggers the "power failure" dim.
@editable
AlarmPlate : trigger_device = trigger_device{}
# Tracks whether we've done the first-press power-up yet.
var PoweredUp : logic = false
OnBegin<override>()<suspends> : void =
# Light starts disabled so it ignores signals until the player powers it up.
TreasureLight.Disable()
# Wire game events to our handler methods.
LightButton.InteractedWithEvent.Subscribe(OnButtonPressed)
AlarmPlate.TriggeredEvent.Subscribe(OnAlarm)
# Runs every time a player interacts with the button.
OnButtonPressed(Agent : agent) : void =
if (PoweredUp?):
# Already powered up — just flip the light state.
TreasureLight.Toggle()
else:
# First press: power up the device and switch the light on.
set PoweredUp = true
TreasureLight.Enable()
TreasureLight.TurnOn()
# Runs when a player steps on the alarm plate.
OnAlarm(Agent : ?agent) : void =
# Dim the light by the editor's Dimming Amount for a power-failure look.
TreasureLight.DimLight()
Line by line:
- The three
@editablefields are how Verse references placed devices. After compiling, you select this Verse device in UEFN and drag your light, button, and trigger into these slots. Without@editablefields you cannot call a placed device's methods. var PoweredUp : logic = falseis class-level state remembering whether the first press happened.- In
OnBegin,TreasureLight.Disable()makes the light inert until powered up. Then weSubscribetwo handlers. Note these are methods of the class, referenced by name —OnButtonPressedandOnAlarm. InteractedWithEventhands the handler a plainagent, soOnButtonPressed(Agent : agent)takes it directly.TriggeredEventhands a?agent(optional), soOnAlarm(Agent : ?agent)matches that signature. We don't even need to unwrap it here since dimming doesn't care who stepped on the plate.- On the first button press we
set PoweredUp = true,Enable()the device, thenTurnOn(). Every press after that callsToggle()to flip on↔off.
Common patterns
Toggle a light directly from a button — the simplest switch:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
light_switch := class(creative_device):
@editable
RoomLight : customizable_light_device = customizable_light_device{}
@editable
SwitchButton : button_device = button_device{}
OnBegin<override>()<suspends> : void =
SwitchButton.InteractedWithEvent.Subscribe(OnSwitch)
OnSwitch(Agent : agent) : void =
# One verb does it all — flips on if off, off if on.
RoomLight.Toggle()
Fade a light up over time with UndimLight — call it repeatedly with a pause between each step to brighten gradually:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
dawn_light := class(creative_device):
@editable
SkyLight : customizable_light_device = customizable_light_device{}
OnBegin<override>()<suspends> : void =
# Start fully dimmed and dark.
SkyLight.TurnOn()
SkyLight.DimLight()
SkyLight.DimLight()
SkyLight.DimLight()
# Sunrise: brighten one step per second.
for (Step := 0..2):
Sleep(1.0)
SkyLight.UndimLight()
Control many tagged lights at once — find every light marked with a Gameplay Tag and switch them together (handy for a puzzle):
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
puzzle_lights := class(creative_device):
@editable
SolveButton : button_device = button_device{}
# Tag your lights with this in UEFN, then we collect them at runtime.
@editable
LightTag : tag = tag{}
OnBegin<override>()<suspends> : void =
SolveButton.InteractedWithEvent.Subscribe(OnSolved)
OnSolved(Agent : agent) : void =
AllLights := GetCreativeObjectsWithTag(LightTag)
for (Obj : AllLights):
if (Light := customizable_light_device[Obj]):
Light.TurnOn()
Gotchas
- Disabled lights ignore everything. If you call
Disable(), a laterTurnOn()does nothing until youEnable()again. In the walkthrough we deliberately disable the light at start so it can't be operated before the player powers it up. - Dimming is relative, not absolute.
DimLightandUndimLightstep by the Dimming Amount set in the device's Details panel — there is no "set brightness to 50%" call. To go fully dim you callDimLightmultiple times; to fade up smoothly, loop withSleepbetween calls (which is why those handlers run in a<suspends>context likeOnBegin). - Match the event's payload type.
button_device.InteractedWithEventgives your handler a plainagent, buttrigger_device.TriggeredEventgives a?agent. If you writeOnAlarm(Agent : agent)for a trigger you'll get a type error — use?agentand unwrap withif (A := Agent?):when you actually need the player. customizable_light_device[Obj]is a failable cast. When iteratingGetCreativeObjectsWithTagresults, the objects arecreative_object_interface, not lights — you must cast inside anifso non-light tagged objects are skipped cleanly.- You must reference the device through an
@editablefield. Callingcustomizable_light_device{}.TurnOn()on a bare constructed value won't touch your placed light. Declare the field, compile, then assign the real device in UEFN.
Guides & scripts that use customizable_light_device
- The "Don't Scream" Alarm: Building a Stealth Trap with VerseSo you want to build a trap that doesn’t just go *BOOM*, but actually warns you (or your enemies) that they’ve messed up? We’re building a **Stealth Alarm System**. Imagine a hallway where a red light pulses slowly while…
- The Art of the "Hey, You!" — Binding Devices in VerseSo, you’ve placed a Trigger, a Timer, and an Explosive Device in your island. They look great. They sit there. They do absolutely nothing when you walk into them. Why? Because in Fortnite Creative, devices are like intro…
- Code the Storm: How to Program Dynamic Lighting in FortniteSo you’ve got a spooky island, but the lighting looks like it was set by a blindfolded artist. You want lights that change color when you eliminate an enemy, or spotlights that follow players like a director with a caffe…
- The Loot Box of Code: Mastering Verse ModulesEver feel like your Verse script is missing a tool? You try to make a door open, but your code just stares back at you like a blank loading screen. That’s because you haven’t unlocked the **Modules**. Think of Modules as…
- Make Your Island Glow Up: A Beginner’s Guide to Light EffectsHave you ever seen a glowing beacon in Fortnite? It guides players home. Or maybe a spooky lantern that flickers in the dark. You can make these yourself!
- Build a Glowing Rube Goldberg MachineDo you love chain reactions? Think of a Rube Goldberg machine. It is a silly, complex machine that does a simple job. Maybe it turns on a light. Or maybe it drops a ball. In Fortnite Creative, you can build these machine…
Build your own lesson with customizable_light_device
Generate a personalized, compile-checked lesson grounded in this exact reference.
Build a lesson →