Stop Making Your Island Look Like a Flat Sticker: A Guide to Shadows in UEFN
Unverified — this example may not compile as-is.
The Verse code below did not pass our automated compile check, so it isn't marked verified and is hidden from the guide listing. The explanation may still be useful, but treat the code as a draft and adapt it before use.
Stop Making Your Island Look Like a Flat Sticker: A Guide to Shadows in UEFN
If your Fortnite island looks like a 2D sticker slapped onto a gray background, it’s not because your building skills are lacking. It’s because you’re ignoring shadows. In the real world, light doesn’t just hit things; it gets blocked, creating depth, drama, and mystery. Without shadows, your players can’t tell if a wall is actually there or if they’re just hallucinating.
In this tutorial, we’re going to fix the "flatness" problem. We’ll learn how to make objects cast shadows, how to tweak those shadows to look cinematic, and how to use Verse to dynamically change the mood of your island—like turning a bright day into a spooky night with a single button press.
What You'll Learn
- CastShadows: The toggle that decides if an object is a ghost or a solid threat.
- Edited Shadows: The color grading tools that let you tint and darken shadows like a pro editor.
- Scene Graph Basics: How objects (entities) and their properties (components) interact.
- Verse Logic: How to use variables and events to change lighting on the fly.
How It Works
The "Ghost" Problem (CastShadows)
Imagine you’re playing a game where you can walk right through walls. That’s what your island looks like if you forget to enable shadows. In UE5 (the engine behind Fortnite), every light source has a setting called CastShadows.
Think of CastShadows like the Hitbox on a prop. If a prop has no hitbox, bullets pass through it. If a light has CastShadows disabled, light passes around it without creating a dark shape on the ground. It’s just... ambient glow. To make a tree look like a tree and not a floating sprite, it needs to cast a shadow.
The "Vibe" Check (Edited Shadows)
Once shadows are casting, they don’t have to be boring black. In the Lumen Exposure Manager (or Light Rig Device), you can tweak the "Edited Shadows" section. This is like the Color Grade filter in a video editor, but it only affects the dark parts of your scene.
- Saturation: Makes your shadows colorful. A green-tinted shadow makes a forest look alive; a blue tint makes a cave look cold.
- Contrast: Controls how sharp the edge between light and dark is. High contrast = dramatic, noir vibes. Low contrast = foggy, soft vibes.
- Gamma: Brightens or darkens the middle tones of the shadow. Think of this as the "shadow depth" slider.
- Gain & Offset: These are the fine-tuners. Gain multiplies the darkness (making it deeper), while Offset adds color to the shadow (washing it out or tinting it).
The Scene Graph: Who Blocks What?
In Verse and Unreal Engine, everything is part of a Scene Graph. This is just a fancy way of saying "the family tree of your game world."
- Entity: A specific object in your world (e.g., "The Big Rock").
- Component: The attributes attached to that entity (e.g., "Rock Mesh," "Light Source," "Physics").
- Hierarchy: The relationship between them. A child entity (like a lamp) is attached to a parent entity (like a table). If you move the table, the lamp moves. If the lamp casts a shadow, the shadow moves with it.
Let's Build It
We’re going to build a Mood Switcher. You’ll place a light source that casts a shadow, and then use Verse to let players change the "vibe" of those shadows from "Bright Day" to "Spooky Night" by pressing a button.
Step 1: The Setup
- Place a Sphere prop in your island. This is our "Shadow Blocker."
- Place a Light (Spotlight or RectLight) pointing at the Sphere.
- CRITICAL: In the Light’s properties, ensure CastShadows is checked (On). If it’s off, the Sphere will look like it’s floating in a void.
- Place a Button device nearby.
Step 2: The Verse Code
Open the Verse editor for the Button device. We need to tell the Button: "When pressed, find the Light and change its shadow settings."
Here is the code. Don’t worry about memorizing it; we’ll break it down line by line.
// 1. Define the structure of our "Mood Switcher"
// This is like a blueprint for the device.
const MoodSwitcher := struct
Light: LightComponent
Button: ButtonDevice
IsSpooky: bool = false // This is our "State Variable"
// 2. The Main Function: What happens when the button is pressed?
@init
main() =
// We wait for the button to be pressed.
// This is an "Event" - like a trigger in UEFN.
Button.PressedEvent.Subscribe(func(event):
// Toggle our spooky state
IsSpooky := !IsSpooky
if (IsSpooky):
// SETTING 1: Turn shadows darker (Gain)
// Think of Gain as multiplying the darkness.
Light.SetShadowGain(0.8)
// SETTING 2: Tint shadows green (Offset)
// Offset adds color to the shadow region.
Light.SetShadowOffset(Color(0.2, 0.5, 0.2, 1.0))
// SETTING 3: Increase contrast (make edges sharper)
Light.SetShadowContrast(1.2)
Print("Spooky Mode Activated!")
else:
# Reset to normal
Light.SetShadowGain(1.0) # Normal brightness
Light.SetShadowOffset(Color(0.0, 0.0, 0.0, 1.0)) # No tint
Light.SetShadowContrast(1.0) # Normal contrast
Print("Normal Mode Restored!")
)
Code Walkthrough
const MoodSwitcher := struct: This defines a Struct. Think of a Struct like a Loadout. It’s a container that holds specific items together. In this case, it holds ourLightand ourButton.IsSpooky: bool = false: This is a Boolean Variable. A Boolean is just a switch that can be ON (true) or OFF (false). It’s like checking a box in the editor. We start withfalse(Normal Mode).@init: This is the Spawn Event. It runs once when the game starts. It sets up our listener.Button.PressedEvent.Subscribe(...): This is the core logic. It says, "Hey, watch this button. Every time it gets pressed, run the code inside these parentheses." This is similar to linking a Button to a Prop-Mover in the UEFN graph, but in Verse, it’s code-driven.!IsSpooky: The!symbol means "NOT." So ifIsSpookyisfalse, it becomestrue. If it’strue, it becomesfalse. It toggles the state.Light.SetShadowGain(...): This is where the magic happens. We are calling a function on theLightcomponent. We are changing the Gain of the shadow. Lower gain = darker shadows.Light.SetShadowOffset(...): We are adding a color tint.Color(0.2, 0.5, 0.2, 1.0)is a dark green. This makes the shadows look like they’re filtered through toxic slime or eerie forest light.
Step 3: Testing
- Save your Verse script.
- Place the Light and Button in your island.
- In the Light Rig Device (or by linking the Light component to the script), make sure the Light is connected to the
Lightvariable in your struct. - Play your island.
- Press the button. Watch the shadows behind the Sphere turn dark green and deeper. Press it again. They return to normal.
Try It Yourself
You’ve got the basics of toggling shadows. Now, let’s make it more interactive.
Challenge: Create a "Sunset Trap."
- Place a large RectLight that acts as the sun.
- Add a Timer device.
- Write Verse code so that when the Timer finishes, the
CastShadowsproperty of the RectLight turns Off for 5 seconds, then turns back On.
Hint: You’ll need to use Light.SetCastShadows(false) and Light.SetCastShadows(true). Think about how to chain the Timer to turn the shadows back on after the delay.
Recap
Shadows aren’t just absence of light; they’re a design tool.
- CastShadows is your on/off switch for depth. Without it, your world is flat.
- Edited Shadows (Gain, Offset, Contrast) let you color-grade the darkness, creating mood without changing the light source itself.
- Verse lets you control these properties dynamically, turning static lighting into an interactive gameplay element.
Next time you build, ask yourself: "Does this object cast a shadow?" If the answer is no, you’re just making a sticker. If the answer is yes, you’re making a world.
References
- https://dev.epicgames.com/documentation/en-us/uefn/using-the-lumen-exposure-manager-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/using-the-lumen-exposure-manager-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/fortnite/light-components-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/uefn/lighting-starter-island-template-in-unreal-editor-for-fortnite
Verse source files
- 01-standalone.verse · standalone
Turn this into a guided course
Add shadows 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.
References
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.