Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Player wont stay on moving part using BodyMovers?

I made a script that allows a part to move between two parts using BodyPosition. However, when the part moves, the player doesn't move with it, and instead just falls off.

local movePart = script.Parent
local startPart = movePart.Parent.StartPart
local endPart = movePart.Parent.EndPart
local bodyPosition = movePart.BodyPosition

movePart.BodyGyro.CFrame = movePart.CFrame

while true do
	bodyPosition.Position = startPart.Position
	wait(5)
	bodyPosition.Position = endPart.Position
	wait(5)
end

GIF to show what I mean: https://gyazo.com/4b4d7592ffcc81861917d49829e1b3fd

1 answer

try changing from this

local movePart = script.Parent
local startPart = movePart.Parent.StartPart
local endPart = movePart.Parent.EndPart
local bodyPosition = movePart.BodyPosition

movePart.BodyGyro.CFrame = movePart.CFrame

while true do
    bodyPosition.Position = startPart.Position
    wait(5)
    bodyPosition.Position = endPart.Position
    wait(5)
end

to this

local movePart = script.Parent
local startPart = movePart.Parent.StartPart
local endPart = movePart.Parent.EndPart
local bodyPosition = movePart.BodyPosition

while true do
    bodyPosition.Position = startPart.Position
    wait(5)
    bodyPosition.Position = endPart.Position
    wait(5)
end

1 comment

0

Thanks for answering. It turns out I didn't actually need that line of code for the BodyGyro. However, it didn't fix the issue of the player not moving with the moving part.

This discussion is preserved as it was. New answers, comments, and votes are closed.