Make Your Own Moving Platforms in Fortnite
Tutorial beginner

Make Your Own Moving Platforms in Fortnite

Updated beginner

Make Your Own Moving Platforms in Fortnite

Do you like playing Fall Guys? Those moving platforms are so much fun! You can make them too. We will build a simple moving platform. It will slide back and forth. Players will have to jump on it to cross a gap. This is a great first step into Verse code.

What You'll Learn

  • How to create a Class in Verse.
  • How to make a prop move using Translation.
  • How to connect your code to a Device in UEFN.

How It Works

Imagine you have a toy car. You want it to drive forward and backward. You need a plan for the car. You need to tell it where to start. You also need to tell it where to go. In Verse, we use a Class for this plan.

A Class is like a blueprint. It is not the car itself. It is the instructions for building the car. We can use this blueprint to make many cars. Each car can move differently.

We will use a concept called Translation. Translation just means changing position. It moves an object from point A to point B. We will make a platform move between two spots.

First, we make a general blueprint for any moving thing. Let's call it movable_prop. This is an Abstract Class. This means it is just a template. You cannot use it directly. You must create a specific version of it.

Then, we create a specific version. Let's call it translating_prop. This version knows how to slide. It has a start point and an end point. When the game starts, it slides from start to end. Then it slides back. It does this forever.

This is how we make the magic happen. We use code to control the movement. No complex math needed!

Let's Build It

We will build a platform that slides left and right. First, open UEFN. Go to the Verse Explorer. Create a new file. Name it moving_platform.verse.

Here is the code. Copy it carefully.

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

# This is our blueprint for any moving object.
# It is abstract, so we cannot use it directly.
movable_prop<public> := class<abstract>():
    # This is the object we will move.
    # It is a "creative_prop" in Fortnite terms.
    # Wire your placed prop to this slot in the Verse Device details panel.
    Prop<public>: creative_prop = creative_prop{}

    # This is where we start moving.
    Start_Position<public>: vector3 = vector3{X := 0.0, Y := 0.0, Z := 0.0}

    # This is where we want to go.
    End_Position<public>: vector3 = vector3{X := 0.0, Y := 0.0, Z := 0.0}

# This is the specific type of moving object.
# It inherits from movable_prop.
# It knows how to translate (slide).
translating_prop<public> := class<concrete>(movable_prop):

    # This function runs once when the game starts.
    # It sets up the platform.
    OnBegin<override>()<suspends>: void =
        # Start the movement loop on its own thread
        # so it does not block the rest of the level.
        spawn { Start_Movement() }

    # This function makes the prop slide.
    Start_Movement()<suspends>: void =
        # We use a loop to keep moving forever.
        # A loop repeats code again and again.
        loop:
            # Move to the end position.
            # MoveToTranslation slides the prop smoothly over a given time (in seconds).
            Prop.MoveTo(End_Position, MakeRotation(vector3{X:=0.0,Y:=0.0,Z:=1.0}, 0.0), 1.0)
            # Wait one second before moving back.
            Sleep(1.0)

            # Move back to the start position.
            Prop.MoveTo(Start_Position, MakeRotation(vector3{X:=0.0,Y:=0.0,Z:=1.0}, 0.0), 1.0)
            # Wait one second before moving forward again.
            Sleep(1.0)```

### Understanding the Code

Let's look at the parts.

The first part is `movable_prop`. It is an **Abstract Class**. Think of it as a blank form. It has a place for the Prop. It has a place for the Start Position. It has a place for the End Position.

The second part is `translating_prop`. It is a **Concrete Class**. This means it is ready to use. It inherits from `movable_prop`. This means it gets all the blank spots filled in.

The `OnBegin` function is special. It runs when the level loads. It finds the prop. Then it calls `Start_Movement`.

The `Start_Movement` function has a `loop` block. A loop is like a record player. It spins the same song over and over. Here, it moves the prop to the end. Then it waits. Then it moves the prop to the start. Then it waits. This makes the platform slide back and forth.

## Try It Yourself

Now, let's put this in your island!

1.  Place a **Prop** in your level. Make it a flat platform.
2.  Place a **Verse Device** next to it.
3.  In the Verse Device settings, find the `Prop` slot. Drag your platform into it.
4.  Set the `Start_Position` and `End_Position`. You can type numbers like `vector3{X:=100.0, Y:=0.0, Z:=0.0}` to move it right.
5.  Run the island!

**Challenge:** Can you make the platform move up and down instead of left and right? Hint: Change the numbers in the `vector3` values. The second number is usually depth. The third number is height.

## Recap

You made a moving platform with Verse! You learned about **Classes**. A class is a blueprint. You learned about **Inheritance**. This means one class can borrow from another. You learned about **Loops**. A loop repeats actions. This is how you make things move over and over. Great job!

## References

*   https://dev.epicgames.com/documentation/en-us/uefn/animating-prop-movement-1-making-movable-props-with-verse-in-verse
*   https://dev.epicgames.com/documentation/en-us/fortnite/animating-prop-movement-1-making-movable-props-in-verse
*   https://dev.epicgames.com/documentation/en-us/uefn/animating-prop-movement-in-verse
*   https://dev.epicgames.com/documentation/en-us/fortnite/animating-prop-movement-6-combining-movement-rotation-and-scale-in-verse
*   https://dev.epicgames.com/documentation/en-us/fortnite/animating-prop-movement-3-translating-props-in-verse

Verse source files

Turn this into a guided course

Add 1. Making Movable Props With Verse 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