Even after researching, i am even more confused on how do this.
i am moving the model using for i loop and a CFrame.new():Lerp() function
local function MoveModel(NewPos: Vector3)
if MOVING then return end
MOVING = true
local NewCFrame = CFrame.new(NewPos)
for i = 0, 0.12, 0.001 do
local Change = MainModel:GetPivot():Lerp(NewCFrame * MainModel:GetPivot().Rotation, i)
MainModel:PivotTo(Change)
task.wait(0.01)
end
MOVING = false
end
local function MoveModel(NewPos: Vector3)
if MOVING then return end
MOVING = true
local CurrentRotation = MainModel:GetPivot().Rotation
local TargetCFrame = CFrame.new(NewPos) * CurrentRotation
for i = 0, 1, 0.02 do
local Change = MainModel:GetPivot():Lerp(TargetCFrame, i)
MainModel:PivotTo(Change)
task.wait(0.01)
end
MOVING = false
end
You can’t do this through a script. Weld the model together and create a hinge constraint that will move it and a script that will activate it. It fixed that problem when i had it.
If you want the player to stay on the platform you either have to code it, such that the player gets moved with the platform(But I don’t know an efficient way to do it so I’m not able to provide a good way) or use physical constraints to move the platform(Physical Constraints automatically move the player along)