How to make a moving platform that also moves parts on top of it

In my puzzle game, I have a moving platform. I want it so that when players, or cubes (If it matters, yes they are tagged) are put on top of it, and it is moved, that they move with the platform.

Currently, this is the structure I have in explorer:
And this is the code found in the MovingPlatformScript:

local TweenService = game:GetService("TweenService")
local CollectionService = game:GetService("CollectionService")

local platform = script.Parent
local glowingPart : Part = platform.Platform.GlowingPart
local root : Part = platform.Platform.Root

local pointAEvent = platform.GoToPointA
local pointBEvent = platform.GoToPointB

local pointA = platform.Parent.PointA
local pointB = platform.Parent.PointB

	local tween = TweenService:Create(root,, Enum.EasingStyle.Linear), { CFrame = pointA.CFrame +, 0.75, 0) })

	local tween = TweenService:Create(root,, Enum.EasingStyle.Linear), { CFrame = pointB.CFrame +, 0.75, 0) })

function moveStart()
	glowingPart.Color =, 1, 0)

function moveFinished()
	glowingPart.Color =, 0, 0)

When the PointA event is fired, it causes the platform to move towards a point above an invisible part named “PointA”. And vice versa with PointB.
(This is using tweens at the moment.)

But currently, when a player stands on top of it, they slide right off.

I tried testing with BodyPosition, but I found that anything other than players also slides off.

And welding wont working. I’ve already seen plenty of posts warning against this for many reasons, in this scenario, it’s because I want players to still be able to move on top of it.

If I’m using BodyPosition, I don’t want to have to manually add a Humanoid to every cube (although I suppose I could script it) and besides, I have sound effects/glowing brick effect that I want to activate once the tween finishes, and as far as I am concerned I can’t detect once it finishes moving.

I’ve heard about raycasts, but the thought of them sounds very daunting. If this is the way, can anybody break down the code that way I can implement it and understand how it works?

What’s the best/any way to achieve what I want?

I hope I’m not being too picky, if I’m missing anything or need more information, please let me know.


you can use bodygyro and bodyvelocity and script for this will look like this:

parent = script.Parent

left =,0,0)
right =,0,0)

while task.wait(2) do
	parent.Velocity = left
	parent.Velocity = right


Settings for BodyGyro and BodyVelocity:
D: 10000
MaxTorque: 400000, 400000, 400000
P: 20000

MaxForce: 400000, 400000, 400000
P: 2000
Velocity: 0, 2, 0

1 Like

Just use a PrismaticConstraint which is Physics based. There are also many Posts about this same problem on the forums so try the Search bar up top.
I built this free model a couple months ago for someone who asked the same question:

PlatformModel - Roblox

You can script it to move however you want it to, they just wanted a button that moved it and returned it.
Have fun with it!


Thank you both of you.

Just a question, will parts on top of the platform still move with it?

Thank you so much!

Your solution works well, but unfortunately, any parts on top of it will not move.

The only way I can get the parts to move (as a temporary solution) is to parent them to a model with a Humanoid and then remove it afterwards.

But this feels very hacky, is there a way to get the prismatic constraint to move objects above it (including non-humanoid characters)?

EDIT: It does seem to actually move parts on top of it, but it isn’t very consistent if multiple parts (e.g. a player) is also standing on it. But I think I can make it work, thank you!

The issue with multiple players and Parts is that the Parts and Platform will be controlled by the Server, and players will be controlled by the client. This may cause lag issues if you have a game with a lot of lag already.

1 Like