In this guide, you will create a simple moving platform using Unreal Engine Blueprints. The platform will move between two points in a loop using the Interp to Movement component. You will also make the movement position and speed editable in the editor, so you can easily adjust each platform in your level.
Create the Blueprint:
Make a new Actor Blueprint for your moving platform.
Add the Platform Mesh:
Add a cube or other mesh to act as the platform and resize it if needed.
Add Movement Component:
Add an Interp to Movement component and change its behaviour to Ping Pong.
Set Up Control Points:
Use the Construction Script to add two control points for the platform’s start and end positions.
Add Editable Variables:
Create a Vector variable for the movement position and a Float variable for the movement duration. Tick Instance Editable this allows you to change the variable’s value directly in the editor. (The Duration variable controls how long it takes for the platform to move between the two control points. A higher number means slower movement).
Connect Blueprint Logic:
Link the control points and duration to the Interp to Movement component to control the movement.
Test in Level:
Drag your platform Blueprint into the level, move the New Position widget to the desired end point, set the Duration, and press Play to test.
Right Click in the content folder >> Select Blueprint Class >> Select Actor
Name You Blueprint and press enter
Double-click on your blueprint to open it
In the components section add your "mesh" component (I will be using a cube for this example)
If necessary resize your mesh component using the transform options on the right when the mesh is selected
In the components section add a "Interp to Movement" component
Select the "Interp to Movement component" in the details section under behaviour, change the behaviour type from one shot to ping pong. (This will allow the platform movement to continuously play from its start position to its second position in a ping pong motion)
Info: Interp to Movement component allows an actor to move smoothly between set points without needing extra scripting.
Info: Changing the behaviour type to Ping Pong makes the platform move back and forth between two points continuously.
Compile your blueprint and drag your blueprint into the level to check if your platform size is suitable
Select "Construction Script"
Pull from your construction script pin and type "Add Control Point" and press enter
Info: Control points define the start and end positions of the platform’s movement path.
You should notice that your interp to movement will already be attached to the control point target
Copy and paste the "Add control point position" so you have 2
On the Left hand side, add a new Vector Variable and call it "NewPosition"
Select the new variable and in the details section on the right tick "Instance Editable" and "Show 3d widget" This will allow us to change the platform movement location
Drag out the NewPosition variable and attach it to the second "control point position"
Info: “Show 3D Widget” makes a visible point in the viewport you can drag to set the movement target.
Create a new "Float variable" and call it "Duration"
In the details panel tick the "instance editable" box. (This will allow us to change the duration of the platform movement)
Info: The Duration variable controls how long it takes for the platform to move between the two control points. A higher number means slower movement.
Copy and paste the "interp to movement variable"
Pull from the copied "interp to movement variable" and type "set duration" and press enter
Drag the "Duration" Variable and plug it into the "Duration" pin on the "Set Duration"
Now ensure that the "First Add control point" is connected to the "Set Duration" and the "Set Duration" is connected to the second "Add control point"
14. Compile and save
15. Drag your moving platform blueprint out into your level
16. There should be a small widget in the middle of your blueprint called "New position" Drag this widget to where you would like your platform to move to.
17. With the blueprint selected in the details panel you can change the Duration of your platform movement, the higher you put this number the slower your platform will move.
Once you are ready you can press play. The platform should move to where you put the new position widget, and the duration of that movement will match the duration you entered on the blueprint. This can be changed for each platform blueprint you bring into your level.