Coding a Moving Platform

So im watching a YouTube tutorial by Roblox on how to script a moving platform at the 9 min mark, and given how im so new to scripting, I have reached a problem and cannot figure out how to solve it.


This is my code, and when I run the game, the platform moves up diagonally, and stops.
image
Am I doing something wrong, what would be the way to fix this?

1 Like

You’re setting it to only one position forever. You have to use an infinite loop to repeatedly change the position of the BodyPosition.

while true do
    bodyPos.Position = position
    wait(waitTime)
    bodyPos.Position = otherPos
    wait(waitTime)
end
1 Like