How to Build a Mood Ring Island
Tutorial beginner

How to Build a Mood Ring Island

Updated beginner

How to Build a Mood Ring Island

Imagine your island is a big room. You want it to feel spooky, or happy, or calm. You can do this with colors!

In this tutorial, we will make a "Mood Ring" island. It will change colors based on the time of day. We will use Verse to pick our colors. We will use devices to show them.

You will learn how to save colors in code. You will learn how to change the look of your island. Let's start making magic!

What You'll Learn

  • What a variable is in Verse.
  • How to pick specific colors for your island.
  • How to change a device's color using code.
  • How to create a mood with just a few colors.

How It Works

Think of a color palette. It is like a set of crayons. You only pick three or four crayons. You use them for everything. This makes your island look neat.

In Verse, we save colors in variables. A variable is like a box. You put a color inside. You give the box a name. Later, you can use that name to find the color.

We will use a VFX Creator Device. This device makes sparkles or lights. We can change its color. We will tell Verse to use our saved colors.

When the game starts, the island will pick a color from our palette. It will turn the lights on. The mood is set!

Let's Build It

We will build a small room. It will have a VFX Creator device. We will write Verse code to change its color.

Step 1: Place Your Devices

  1. Open UEFN and create a new island.
  2. Place a VFX Creator Device in the center of your map.
  3. Place a Simple Actor (like a box) next to it. This is just to see the light.
  4. Make sure the VFX Creator is set to "Loop" so it keeps going.

Step 2: Write the Code

Click on the VFX Creator device. Open the Verse tab. Clear any old code. Paste this code in.

using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Colors }
using { /Verse.org/Random }

# This is our "Mood Ring" script!

mood_ring_device := class(creative_device):

    # Wire your VFX Creator Device to this property in the UEFN editor.
    @editable
    VFX_Device : vfx_creator_device = vfx_creator_device{}

    # 1. Define the colors we want to use.
    # We call these "constants" because they don't change.
    # Think of them as fixed crayons in a box.
    Red_Crayon : color = color{R:=1.0, G:=0.0, B:=0.0}
    Blue_Crayon : color = color{R:=0.0, G:=0.0, B:=1.0}
    Green_Crayon : color = color{R:=0.0, G:=1.0, B:=0.0}

    # 2. Create a list of our colors.
    # This is like a tray holding all our crayons.
    Our_Palette<internal> : []color = array{}

    # 3. This function runs when the game starts.
    OnBegin<override>()<suspends> : void =
        # Build our palette list from the crayon constants.
        set Our_Palette = array{Red_Crayon, Blue_Crayon, Green_Crayon}

        # Pick a random crayon from the tray.
        # We use a random index to choose one.
        Random_Index := GetRandomInt(0, Our_Palette.Length - 1)
        if (Chosen_Color := Our_Palette[Random_Index]):
            # 4. Change the device's color!
            # This sets the main color of the sparkles.
            VFX_Device.SetNiagaraVariableLinearColor("User.Color", Chosen_Color)
            # note: vfx_creator_device exposes Niagara variable setters;
            # the exact variable name must match what is defined inside
            # your chosen Niagara system asset.

            # 5. Print a message to help us debug.
            Print("Mood color chosen at index: {Random_Index}")```

### Step 3: Understanding the Code

Let's look at what each part does.

*   **`color{R:=1.0, G:=0.0, B:=0.0, A:=1.0}`**: This is how Verse writes a color. It uses numbers between 0.0 and 1.0. `R` is red. `G` is green. `B` is blue. `A` is opacity. All four fields together make one color.
*   **`Our_Palette`**: This is a list. It holds our three colors. We can pick from it later.
*   **`GetRandomInt(0, 2)`**: This picks a random number. It will be 0, 1, or 2. This picks a random color from our list.
*   **`SetNiagaraVariableLinearColor`**: This is a command. It tells the VFX Creator device to change a color variable inside its particle system.

### Step 4: Fix the Colors

The code above already uses real color values. You can adjust them to any mood you like.

1.  Each channel (`R`, `G`, `B`) goes from **0.0** (none) to **1.0** (full).
2.  You can go above 1.0 for HDR brightness, which looks great with lights and VFX.
3.  For example, a soft purple is `color{R:=0.5, G:=0.0, B:=1.0, A:=1.0}`.

Let's update the code to use some mood-setting colors.

```verse
# Updated with mood-setting color values
Red_Crayon : color = color{R:=1.0, G:=0.0, B:=0.0, A:=1.0}   # Bright Red
Blue_Crayon : color = color{R:=0.0, G:=0.2, B:=1.0, A:=1.0}  # Bright Blue
Green_Crayon : color = color{R:=0.0, G:=1.0, B:=0.2, A:=1.0} # Bright Green

Now, when you play, the VFX Creator will flash Red, Blue, or Green randomly.

Try It Yourself

You did it! You made a mood-changing island. Now, try this challenge.

Challenge: Make the island change color when a player steps on a trigger.

Hint:

  1. Place a Trigger Volume device.
  2. Use the TriggeredEvent subscription in Verse.
  3. Inside that event, change the color of the VFX Creator again.
  4. You can use a different color each time!

Don't worry if it breaks. That's how we learn. Check your spelling in Verse. Check your device IDs.

Recap

You learned how to use colors in Verse. You made a list of colors. You picked one at random. You changed a device's color with code.

Colors set the mood. A red light feels scary. A blue light feels calm. You control the feeling of your island.

Great job, coder! Keep building.

References

  • https://dev.epicgames.com/documentation/en-us/fortnite/making-cinematics-2-lighting-and-color-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/community/snippets/9VQ/fortnite-digests-release-24-20-cl-24939793
  • https://github.com/vz-creates/uefn
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-vfx-creator-devices-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-video-player-devices-in-fortnite-creative

Verse source files

Turn this into a guided course

Add Color Palette 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