How To Make A Player Stick To A Moving Part

I’m new to scripting and i made a moving part cycle but i want to know if there’s anyway to get the player to stay on the moving part without falling off/moving.

-Here’s The Script

local MovingPart = game.Workspace.MovingPart
local TweenService = game:GetService(“TweenService”)

while true do
local goal = {}
goal.Position = Vector3.new(70.359, 0.5, -118.235)

local tweenInfo = TweenInfo.new(4)

local tween = TweenService:Create(MovingPart, tweenInfo, goal)
tween:Play()
task.wait(4)
local goal2 = {}
goal2.Position = Vector3.new(70.359, 0.5, -88.735)

local tween2 = TweenService:Create(MovingPart, tweenInfo, goal2)
tween2:Play()
task.wait(4)
local goal3 = {}
goal3.Position = Vector3.new(98.359, 0.5, -88.735)

local tween3 = TweenService:Create(MovingPart, tweenInfo, goal3)
tween3:Play()
task.wait(4)
goal4 = {}
goal4.Position = Vector3.new(98.359, 0.5, -118.235)

local tween4 = TweenService:Create(MovingPart, tweenInfo, goal4)
tween4:Play()

task.wait(4)
end

You don’t actually use scripts for this, you can use cylindrical constraints.

You need 2 parts, one which is one stud small and is in the center of the other part.

The properties should be like this.

Oh wait sorry, its a moving part, not a spinning part

Pretty sure this video will help

OH COME ON, THIS VIDEO USES DEPRECATED METHODS…
Instead use AlignPosition which is a physics object
https://create.roblox.com/docs/reference/engine/classes/AlignPosition

3 Likes

There are a bunch of ways to do it.
If you try searching the forums for terms like “moving platform” or “stick player to part platform” you’d get lots of hits.

Here goes the explanations again:
You can’t do it physically with a CFramed tweened Part because CFraming isn’t a physical movement.

  • You can Weld an Unanchored, CanCollide true Part to your Anchored, Cancollide false tweened Part and the player will move on the welded Part since it’s physically moved in the workspace.
  • You can use a PrismaticConstraint (sorry @bolzpy, but a CylindricalConstraint isn’t the best for this) set to Servo like I used in a tutorial for another player a while ago: PlatformModel - Roblox.
  • You can use AlignPosition as @PehqDev mentioned.
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.