Make Your Props Dance with Verse
Tutorial beginner compiles

Make Your Props Dance with Verse

Updated beginner Code verified

Make Your Props Dance with Verse

Do you ever wish your props could do more than just sit there? Imagine a treasure chest that bobs up and down like it is breathing. Or a platform that pulses with energy. We can make this happen! We will use Verse to control movement. You will see your island come alive.

What You'll Learn

  • How to pick a prop to move.
  • How to make it move up and down.
  • How to use a "loop" to keep it moving forever.
  • How to change how fast it moves.

How It Works

Think of a prop like a toy soldier. It has a spot on the floor. We call this its Location. It has three numbers: left-right, forward-back, and up-down.

We want the up-down number to change. But we do not want it to jump randomly. We want it to move smoothly. Like a wave in the ocean.

A wave goes up, then down, then up again. This shape is called a Sine Wave. It is a smooth curve. We can use math to make this curve.

We will use a Loop. A loop is like a record player. It spins the same song over and over. In code, it runs the same lines again and again.

Inside the loop, we will check the time. We will use the time to find the height of the wave. Then we will tell the prop to move to that height.

This is called Dynamic Movement. "Dynamic" means it changes. It is not static. Static means still. We want moving!

Let's Build It

First, place a Prop in your island. Pick something fun. A mushroom or a box is good.

Now, we will write Verse code. This code tells the prop what to do.

# This is our main script
# It connects to the Prop we placed
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }

# We create a special device for our code
# creative_device is the real base class for island scripts
my_moving_prop := class(creative_device):

    # This is the prop we want to move
    # It is like a named slot for the object
    # Mark it @editable so you can assign it in the UEFN details panel
    @editable
    Prop : creative_prop = creative_prop{}

    # This is a variable for speed
    # Variables can change their value
    var Speed : float = 2.0

    # This function starts the action
    # It runs once when the game begins
    OnBegin<override>()<suspends> : void =
        # We enter a loop here
        # A loop repeats code forever
        loop:
            # Get the current time in seconds
            # Time is always moving forward
            CurrentTime := GetSimulationElapsedTime()

            # Calculate the height using a Sine Wave
            # Sin() makes a smooth up-and-down curve
            # We multiply by Speed to change how fast it waves
            Height := Sin(CurrentTime * Speed) * 200.0

            # Get the prop's current spot
            CurrentTransform := Prop.GetTransform()
            CurrentLocation := CurrentTransform.Translation

            # Create a new location
            # We keep left-right and forward-back the same
            # We only change the up-down part (Z)
            NewLocation := vector3{X := CurrentLocation.X, Y := CurrentLocation.Y, Z := CurrentLocation.Z + Height}

            # Move the prop to the new spot
            # This happens every frame!
            # TeleportTo is the real API for repositioning a creative_prop
            if (Prop.TeleportTo[NewLocation, CurrentTransform.Rotation]):
                false

            # Wait a tiny bit before the next move
            # This keeps the game smooth
            Sleep(1.0 / 60.0)```

### What Each Part Does

1.  **`my_moving_prop := class(creative_device)`**: This creates a template. Think of it like a cookie cutter. It tells Verse what our prop object looks like.
2.  **`Prop : creative_prop`**: This is a **Variable**. It holds the link to the actual prop in your level.
3.  **`loop:`**: This is the **Loop**. It says "keep doing this forever." Without it, the prop would move once and stop.
4.  **`Sin(CurrentTime * Speed)`**: This is the magic math. `Sin` creates the wave shape. `CurrentTime` makes it move over time. `Speed` makes it go faster or slower.
5.  **`TeleportTo`**: This moves the prop. It updates its position on the screen.

## Try It Yourself

You made the prop bob up and down. Now, let's make it cooler.

**Challenge:** Make the prop spin around while it bobs.

**Hint:** You need to change the **Rotation** of the prop, not just the **Location**. Look for a function like `MakeRotationFromYawPitchRollDegrees`. You can add a small amount to the Yaw (side-to-side spin) each time the loop runs.

Don't worry if it looks weird at first. That is how you learn!

## Recap

*   **Variables** store values like speed or position.
*   **Loops** repeat code to create continuous action.
*   **Sine Waves** create smooth, natural-looking movement.
*   **Verse** lets you control props dynamically.

You just made a prop dance! Great job. Keep experimenting.

## References

*   https://dev.epicgames.com/documentation/en-us/fortnite/create-dynamic-movement-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/uefn/create-dynamic-movement-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/fortnite/using-player-movement-devices
*   https://dev.epicgames.com/documentation/en-us/fortnite/creating-custom-skilled-interactions-in-unreal-editor-for-fortnite
*   https://dev.epicgames.com/documentation/en-us/uefn/animated-mesh-device-in-unreal-editor-for-fortnite

Verse source files

Turn this into a guided course

Add create-dynamic-movement-in-unreal-editor-for-fortnite 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