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

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

Updated beginner Code verified

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

Do you want your Fortnite island to feel magical? Maybe you want a cave that glows with neon colors. Or a portal that pulses with energy. You can do this with Light Functions.

Think of a Light Function as a special sticker for your lights. It changes how the light looks. It can add colors, patterns, or shapes. This tutorial shows you how to make a simple glowing beacon. You will use Verse to control it. Let's get started!

What You'll Learn

  • What a Light Function is.
  • How to attach a Light Function to a light.
  • How to use Verse to turn the glow on and off.
  • How to make your island look more exciting.

How It Works

Imagine you have a flashlight. The light beam is white and plain. Now, imagine putting a colored plastic sheet in front of it. The beam changes color! That sheet is like a Light Function.

In Fortnite, a Light is a device that shines light. A Light Function is an asset that changes that light. You can add textures. You can add colors. You can even make it pulse.

Here is the key idea: Hierarchy. In Unreal Engine, objects are like a family tree. This is called the Scene Graph.

  • The Light is the parent.
  • The Light Function is a child or accessory.
  • When the Light shines, it uses the Light Function's style.

We will use Verse to control this. Verse is the language we use to give our island instructions. We will write code to change the Light Function's brightness. This makes the light pulse!

Let's Build It

We will build a "Magic Beacon." It will be a simple light that glows brighter and dimmer.

Step 1: Set Up Your Island

  1. Open UEFN (Unreal Editor for Fortnite).
  2. Place a Point Light device on your island.
  3. Place a Player Spawn nearby so you can test it.

Step 2: Add the Light Function

  1. Go to the Content Browser.
  2. Search for "Light Function."
  3. Drag a Light Function asset into your scene.
  4. Attach it to your Point Light. In the details panel, find the "Light Function" slot. Drop your asset there.

Step 3: Write the Verse Code

Now, we write code to make it pulse. We will use a Timer. A timer counts down. When it hits zero, it triggers an event. We will use this to change the brightness.

Here is the code. Copy this into a Verse file.

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

# This is our main script block.
# It holds our variables and logic.
beacon_controller := class(creative_device) {

    # A variable to hold our light device.
    # We will set this in the editor.
    @editable
    MyLight: customizable_light_device = customizable_light_device{}

    # A variable for brightness, stored as a float we can change.
    # Light Function materials are set up in the editor; we drive
    # pulsing by toggling the light device's intensity instead.
    # note: Verse has no runtime LightFunctionMaterial API; brightness
    # is approximated via the customizable_light_device Enable/Disable cycle.
    var IsBright : logic = true

    # This event runs when the game starts.
    OnBegin<override>()<suspends>: void = {
        # Start the pulsing loop immediately.
        PulseLight()
    }

    # This is a custom function.
    # It makes the light get brighter and dimmer.
    PulseLight()<suspends>: void = {
        # We loop forever.
        loop {
            # Set the light to its full "bright" state.
            # The light function material (set in the editor) is now visible.
            MyLight.Enable()

            # Wait for 1 second.
            # This pauses the code briefly.
            Sleep(1.0)

            # Disable the light to simulate the "dim" state.
            MyLight.Disable()

            # Wait for 1 second again.
            Sleep(1.0)
        }
    }
}

Walkthrough of the Code

  1. beacon_controller := class(creative_device): This creates a new creative device class. It is like a container for our code.
  2. @editable MyLight: customizable_light_device: This is a variable. The @editable tag lets you assign it in the UEFN editor. It remembers which light we are controlling.
  3. OnBegin<override>(): This is an event. It runs once when the level starts. It is like the "Go" signal for a race.
  4. PulseLight(): We call our custom function here to start the pulse as soon as the game begins.
  5. loop: This is a loop. It repeats code over and over. Like a record player spinning.
  6. MyLight.Enable() / MyLight.Disable(): These turn the light on and off. This simulates the bright and dim states of the pulse. The Light Function material you attached in the editor controls the color and pattern while the light is on.
  7. Sleep(1.0): This waits. It pauses the code for one second. Without this, the light would change too fast to see.

Try It Yourself

You did it! You made a pulsing light. Now, try these challenges:

  1. Change the Speed: Change Sleep(1.0) to Sleep(0.5). What happens? The light pulses faster!
  2. Add a Color: In the editor, change the Light Function's material to blue. Does the pulse look different?
  3. Make it Stop: Can you add an if statement to stop the loop after 10 seconds? (Hint: Use a counter variable!)

Hint for Challenge 3: Create a new variable called Count. Increase it by 1 each loop. If Count is greater than 10, use break to exit the loop.

Recap

Light Functions are like stickers for your lights. They add color and style. You attach them to a light device in the editor. Then, you use Verse to control them. You can change brightness, color, and more. This makes your island feel alive. Keep experimenting!

References

  • https://dev.epicgames.com/documentation/en-us/uefn/talisman-art-asset-gallery-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/UE/building-virtual-worlds/lighting-and-shadows/features-of-lights/light-functions
  • https://dev.epicgames.com/documentation/en-us/fortnite/talisman-art-asset-gallery-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/environment-light-rig-device-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/uefn/material-library-in-unreal-editor-for-fortnite

Verse source files

Turn this into a guided course

Add light-functions 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