Hello everyone, I am trying to make a part move to a certain position using a bodyPosition, the part is unanchored and it moves to the desired position, however, when the player jumps on the part, he doesn’t move with it.
Here is the script I am using
local RunService = game:GetService("RunService")
local part = script.Parent
local bodyPosition = part.BodyPosition
local bodyAngularVelocity = part.BodyAngularVelocity
bodyPosition.Position = part.Position
bodyPosition.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyPosition.P = 10000000000000000000000
bodyPosition.D = 100000000000
bodyAngularVelocity.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
local start = part.Position
local target = Vector3.new(2, 1.5, 55)
local targetMinusStart = target - start
local startMinusTarget = start - target
local loopNumber = 70
while true do
for i = 0, loopNumber, 1 do
bodyPosition.Position = bodyPosition.Position + targetMinusStart / loopNumber
wait()
end
for i = 0, loopNumber, 1 do
bodyPosition.Position = bodyPosition.Position + startMinusTarget / loopNumber
wait()
end
end