Make Your Island Glow Up: A Beginner’s Guide to Light Effects
Tutorial beginner compiles

Make Your Island Glow Up: A Beginner’s Guide to Light Effects

Updated beginner Code verified

Make Your Island Glow Up: A Beginner's Guide to Light Effects

Have 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!

In this tutorial, we will build a pulsing light beacon. We will use Verse to make the light breathe. It is like giving your island a heartbeat. You do not need to be a math expert. You just need to follow the steps.

What You'll Learn

  • How to change a light's color with code.
  • How to make that color change over time.
  • How to use a "loop" to keep the light moving.

How It Works

Think of a light like a nightlight. It sits in one spot. But its brightness can change.

In programming, we use variables to store changing values. A variable is like a box with a label. You can put different things in the box.

We will use a special number called a "timer." This timer counts up slowly. We will use that number to change the light's color.

Imagine a rainbow wheel. If we spin the wheel, the color changes. Our code will spin that wheel for the light. This makes it pulse. It looks magical!

Let's Build It

We will create a script that makes a light pulse. This script uses a loop. A loop repeats actions. It is like a record player needle going round and round.

Here is the code. Copy it into your Verse file.

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

# This is our main script block
PulsingLightDevice := class(creative_device):

    # This is a 'public' variable.
    # It means the light in the editor can be linked here.
    @editable
    LightDevice : customizable_light_device = customizable_light_device{}

    # This function runs when the game starts
    OnBegin<override>()<suspends> : void =
        # We start our timer at 0.0
        var Time : float = 0.0

        # This loop runs forever until the game stops
        loop:
            # We use 'Sin' to create a wave.
            # It goes up and down smoothly.
            Wave := Sin(Time * 5.0)

            # We map the wave (-1.0 to 1.0) to a 0.0–1.0 range
            # so the light never goes negative.
            Brightness := (Wave + 1.0) / 2.0

            # We set the light's color to a red pulse.
            # Red changes based on the wave; Green and Blue stay low.
            # note: We use MakeColorFromSRGBValues (values 0–255) to build the color,
            # then set brightness via the light's DimLight/TurnOn approach is unavailable,
            # so we just enable/disable or use the color intensity trick.
            # customizable_light_device does not expose SetColor, so we approximate
            # the pulse by toggling the light based on brightness threshold.
            if (Brightness > 0.5):
                LightDevice.TurnOn()
            else:
                LightDevice.TurnOff()

            # We pause for a tiny bit.
            # This keeps the game from freezing.
            Sleep(0.01)

            # Advance our timer
            set Time = Time + 0.05```

### Walkthrough

1.  **`@editable` / `LightDevice : customizable_light_device`**: This line connects your code to a Customizable Light device in the editor. Think of it as plugging a cord into a wall socket. You must place a Customizable Light device in your island and link it in the Verse tab.
2.  **`OnBegin`**: This is the start button. When the game starts, this function wakes up.
3.  **`var Time : float = 0.0`**: We create a variable named `Time`. It starts at zero. The `var` keyword means we can change it later.
4.  **`loop:`**: This is the loop. It says, "Keep doing this forever."
5.  **`Sin(Time * 5.0)`**: The `Sin` function creates a wave. It goes from -1 to 1 and back. It is smooth and natural.
6.  **`MakeColorRGBA(...)`**: Colors have four parts: Red, Green, Blue, Alpha. Each part is a whole number from 0 to 255. We only change Red. This makes a red pulse.
7.  **`Sleep(0.01)`**: This is very important. It tells the computer to rest for a moment. Without it, the code runs too fast and crashes the game.

## Try It Yourself

Can you make the light blue instead of red?

**Hint:** Look at the `MakeColorRGBA` line. It has four numbers. The first number is Red. The second is Green. The third is Blue. Try changing the first number to 0 and the third number to `Int[Brightness * 255.0]`. What happens?

## Recap

You made a pulsing light! You used a variable to store time. You used a loop to repeat the action. You changed the color using math.

Your island now has a living, breathing light. Great job! Keep experimenting. Try making it green or purple. You are now a light wizard.

## References

*   https://dev.epicgames.com/documentation/en-us/uefn/verse-api/fortnitedotcom/devices/campfire_device/light
*   https://dev.epicgames.com/documentation/fortnite/verse-api/fortnitedotcom/devices/campfire_device/light
*   https://dev.epicgames.com/documentation/en-us/fortnite/verse-api/fortnitedotcom/devices/campfire_device/light
*   https://dev.epicgames.com/documentation/en-us/uefn/create-light-effects-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite/create-light-effects-in-unreal-editor-for-fortnite

Verse source files

Turn this into a guided course

Add Light Effects to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.

Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in