Moving platform issue

Trying to figure out why the platform in my test model does slide back and forth. It currently goes from a starting point to the destination OK, but rather than sliding back it jumps back to the start position… so if a player is riding the platform and the platform jumps over, the player simply falls.

RobloxStudioBeta_ykkK9nqFgd

local model = script.Parent

local platform = model.Platform
local positionA = model.PlatformStart.Position
local positionB = model.PlatformEnd.Position

while true do
    platform.Position = positionB
    wait(6)
    platform.Position = positionA
    wait(6)
end

Any ideas would be greatly appreciated :beers:

Consider using TweenService when animating your part as opposed to what you’ve done.

Edit: Please post this in #help-and-feedback:scripting-support

Have tried that as well. From playing around, the player did not stay on the part when using a tween. It just slides under the player.

Try welding the player in the part when moving.

No offence, but don’t assume people don’t search just because you don’t feel somebody has thought it through. I’ve read through many, many posts to look for a simple elegant solution, to what seems like a simple problem using constraints to achieve the goal, and feels like I’m half way there.

Considering this is pretty simple with the legacy body movers, I feel it should be fairly simple with constraints as well.

For reference, legacy body mover example:

Solved this simply by changing the following var (from code block above)

from:
local platform = model.Platform

to:
local platform = model.PlatformAnchor

It’s working as expected now