BodyPosition Not Working

Hello Developers, I need your help!

I am a scripter who uses TweenService, but for an obby I need to use BodyPosition. (So that players stick to the block)

The only problem is that when I tell it to go to a set position it does not go to that position, instead it goes to another spot. Please help!

The script:

local Model = game.Workspace.MoveModel
local BodyPosition = Model.Platform.BodyPosition

while true do
	BodyPosition.Position = Model.Start
	wait(4)
	BodyPosition.Position = Model.End
	wait(4)
end

What is the .Start and .End attached to the model?

Don’t use TweenService. Try a PrismaticConstraint on the platform and players will stay on it!

Yes, it is attached. The start and end are both in the same model.

All you would need to do is change Model.Start to Model.Start.Position, because you are assigning a Vector3 value with an Instance.

The only problem is that I dont know how to use that.

It’s pretty easy if you go to the roblox.developer.com page PrismaticConstraint | Documentation - Roblox Creator Hub and read up there.
Click on the add constraints tool in the Model tab in Studio, select PrismaticConstraint, and then click on one Anchored Part as the base for your slider. Click on the Platform you want to move to Attach the other end of the constraint there. Make sure both are aligned in a straight line.
Make sure the Platform isn’t Anchored.
Set the ActuatorType of the Prismatic to Servo.
Set your Speed and ServoMaxForce in the Properties page as well.
Use your looping script to set the TargetPosition for the position the PrismaticConstraint will be at when the platform is at its destination, wait, then set the TargetPosition for the platform’s original position to send it back there, and wait again.