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)
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.