Reference Devices compiles

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.

Updated Examples verified on the live UEFN compiler
Watch the Knotcustomizable_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/Disable control whether the device responds at all. A disabled light won't react to TurnOn.
  • TurnOn/TurnOff/Toggle flip the light's lit state.
  • DimLight/UndimLight step 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 @editable fields 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 @editable fields you cannot call a placed device's methods.
  • var PoweredUp : logic = false is class-level state remembering whether the first press happened.
  • In OnBegin, TreasureLight.Disable() makes the light inert until powered up. Then we Subscribe two handlers. Note these are methods of the class, referenced by name — OnButtonPressed and OnAlarm.
  • InteractedWithEvent hands the handler a plain agent, so OnButtonPressed(Agent : agent) takes it directly.
  • TriggeredEvent hands a ?agent (optional), so OnAlarm(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, then TurnOn(). Every press after that calls Toggle() 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 later TurnOn() does nothing until you Enable() 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. DimLight and UndimLight step by the Dimming Amount set in the device's Details panel — there is no "set brightness to 50%" call. To go fully dim you call DimLight multiple times; to fade up smoothly, loop with Sleep between calls (which is why those handlers run in a <suspends> context like OnBegin).
  • Match the event's payload type. button_device.InteractedWithEvent gives your handler a plain agent, but trigger_device.TriggeredEvent gives a ?agent. If you write OnAlarm(Agent : agent) for a trigger you'll get a type error — use ?agent and unwrap with if (A := Agent?): when you actually need the player.
  • customizable_light_device[Obj] is a failable cast. When iterating GetCreativeObjectsWithTag results, the objects are creative_object_interface, not lights — you must cast inside an if so non-light tagged objects are skipped cleanly.
  • You must reference the device through an @editable field. Calling customizable_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.

Device Settings & Options

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

Customizable Light Device settings and options panel in the UEFN editor — Initial State, Color
Customizable Light Device — User Options in the UEFN editor: Initial State, Color
⚙️ Settings on this device (2)

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

Initial State
Color

Guides & scripts that use customizable_light_device

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

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