Make Your Props Dance: A Beginner’s Guide to Verse Pathfinding
Tutorial beginner

Make Your Props Dance: A Beginner’s Guide to Verse Pathfinding

Updated beginner

Make Your Props Dance: A Beginner’s Guide to Verse Pathfinding

Stop letting your props sit there like they’re waiting for a bus that already left. Whether you want a floating platform to carry players through an obstacle course, a boat to patrol your lake, or just a cool rotating sign, Verse gives you the power to make anything move on a schedule. We’re going to build a custom device that takes a list of waypoints and smoothly glides a prop between them, so you can create dynamic maps without manually keyframing every second.

What You'll Learn

  • Variables as Inventory Slots: How to store changing data (like "current waypoint") in your code.
  • Arrays as Playlists: Managing a list of objects (your path) instead of hard-coding individual positions.
  • The Scene Graph & Hierarchy: Understanding how devices interact with props in the 3D world.
  • Loops as Repetitive Tasks: Making your code check its progress over and over until the job is done.

How It Works

Imagine you’re setting up a Prop Mover device in UEFN. You tell it: "Go to Point A, then Point B." But what if you want a prop to visit five different points, or go back and forth? Hard-coding that for every prop is a nightmare.

In programming, we use a Variable to hold a value that changes. Think of a variable like a Health Bar. It starts at 100, but as you take damage, the number inside that bar changes. In our case, we need a variable to track which waypoint the prop is currently heading to. Let’s call it CurrentWaypointIndex.

We also need a way to store all the waypoints. In Fortnite, you might place several Flag props to mark a race track. In Verse, we store these in an Array. An array is like a Loot Pool or a Playlist. It’s a single container that holds a list of items. You can add or remove items, but you access them by their position in the list (Index 0 is the first item, Index 1 is the second, etc.).

The magic happens in a Loop. A loop is like the Storm Timer or a Respawn Cycle. It’s a block of code that repeats continuously. Our script will say: "Check if we’ve reached the current waypoint. If yes, move to the next one in the list. If we hit the end, wrap around to the start."

We’ll use a Creative Device as the brain. You place this device in your level, assign it the prop you want to move, and assign it the list of waypoints. The device then handles the math, calculating the distance and speed to slide the prop smoothly from A to B, B to C, and so on.

Let's Build It

We are going to create a device called PathFollower. It will take a Prop to move, a list of Waypoints (which can be any props, like flags or cubes), and a Speed.

Step 1: The Setup

  1. Open UEFN and create a new Verse Device. Name it PathFollower.
  2. In the Details Panel of your new device, you will see editable fields. We need to define what goes into them.

Step 2: The Code

Copy this code into your Verse file. Don’t worry if it looks scary; we’ll break it down line by line.

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

# This is our custom device. Think of it as a new type of device you're inventing.
PathFollower := class(creative_device):

    # @editable means these fields show up in the UEFN Details panel.
    # You can drag and drop items here in the editor.
    
    # The object we want to move (e.g., a boat, a platform)
    PropToMove: creative_prop := creative_prop{}
    
    # How fast it moves (in Unreal Units per second)
    Speed: float := 500.0
    
    # The list of waypoints (flags, cubes, etc.) that define the path
    Waypoints: []creative_prop := array{}
    
    # Internal variables (not visible in editor, used for logic)
    var current_index: int = 0
    var is_moving: bool = false

    # OnBegin runs once when the island starts.
    OnBegin<override>()<suspends>: void =
        # Check if we actually have a prop and waypoints assigned
        if PropToMove != creative_prop{} and len(Waypoints) > 0:
            # Start the movement loop
            _StartMoving()

    # A helper function to handle the actual movement loop
    _StartMoving(): void =
        loop:
            # Get the target location from the current waypoint in our list
            target_prop := Waypoints[current_index]
            
            # If the waypoint exists, get its location
            if target_prop != creative_prop{}:
                target_location := target_prop.GetTransform().Location
                
                # Calculate direction and distance
                direction := target_location - PropToMove.GetTransform().Location
                distance := len(direction)
                
                # If we are close enough to the target (within 10 units), move to next
                if distance < 10.0:
                    # Move to the next waypoint
                    current_index = (current_index + 1) % len(Waypoints)
                    # Wait a tiny bit to prevent instant jumping
                    Wait(0.1)
                else:
                    # Move towards the target
                    # Normalize direction (make it length 1) then multiply by speed
                    move_step := (direction / distance) * Speed * 0.016 # 0.016 is approx 1/60th of a second
                    PropToMove.SetLocation(PropToMove.GetTransform().Location + move_step)
                    
                    # Pause for one frame (approx 16ms)
                    Wait(0.016)

Step 3: Walkthrough

  1. using { ... }: These are like loading Mods or Items into your inventory. We need the Device toolkit, the Simulation rules (for time and logic), and Spatial Math (for 3D coordinates).
  2. PathFollower := class(creative_device):: This defines our new device. It inherits from creative_device, meaning it acts like any other device in UEFN.
  3. @editable fields:
    • PropToMove: This is your Target. In the editor, you drag your boat/platform here.
    • Speed: This is your Speed Stat. Higher number = faster.
    • Waypoints: This is your Playlist. You drag multiple props (like flags) into this list in the editor. Order matters! Index 0 is first, Index 1 is second.
  4. OnBegin: This is the Game Start event. It runs once when players join. It checks if you’ve actually assigned a prop and waypoints. If not, it does nothing (preventing errors).
  5. _StartMoving: This is the Loop.
    • target_prop := Waypoints[current_index]: We grab the current waypoint from our list.
    • distance := len(direction): We calculate how far we are from the target.
    • if distance < 10.0: If we’re close enough (like a Trigger Volume), we switch to the next waypoint.
    • current_index = (current_index + 1) % len(Waypoints): This is the Wrap-Around trick. If we’re at the last item (index 4) and add 1, we get 5. But % len(Waypoints) (modulo) wraps it back to 0. It’s like a Round Reset.
    • PropToMove.SetLocation(...): We actually move the prop. We calculate a small step toward the target and apply it.
    • Wait(...): This is crucial. Without waiting, the code runs too fast and the prop teleports. Wait pauses the code for a fraction of a second, creating smooth animation.

Step 4: Building It in UEFN

  1. Place your PathFollower device in the level.
  2. Place your Prop (e.g., a Boat) in the level.
  3. Place several Props to act as waypoints (e.g., 3-4 simple cubes or flags).
  4. Select your PathFollower device.
  5. In the Details Panel:
    • Drag your Boat into the PropToMove field.
    • Drag your Waypoint Props into the Waypoints array. Tip: Click the + button to add multiple entries.
    • Set your Speed to something like 300.0.
  6. Playtest! Your prop should now glide from the first waypoint to the second, then the third, and loop back to the first.

Try It Yourself

Challenge: Make the prop move back and forth instead of looping in a circle.

Hint: You need to change how current_index updates. Instead of always adding 1, add a variable called direction_step that is either 1 or -1. When the prop hits the last waypoint, flip direction_step to -1. When it hits the first, flip it back to 1.

Recap

  • Variables are like changing stats (Health, Ammo) that update during gameplay.
  • Arrays are like Playlists or Loot Pools, holding a list of items you can access by index.
  • Loops are like the Storm or Respawn cycles, repeating code until a condition is met.
  • Scene Graph interactions involve devices (brains) manipulating props (objects) via their Transform (position/rotation).

Now go make some props dance!

References

  • https://dev.epicgames.com/community/snippets/gQm/fortnite-how-to-make-a-prop-follow-a-path
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/fall-guys-designing-an-obstacle-course-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/create-your-own-device-using-verse-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite/objective-marker-gameplay-tutorial-in-unreal-editor-for-fortnite
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/d-launcher-device-design-examples-in-fortnite-creative

Verse source files

Turn this into a guided course

Add fortnite-how-to-make-a-prop-follow-a-path 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