I am using the :MoveTo() function to move a vehicle model to a specific part position in workspace. The code is as follows below:
The vehicle is getting moved to the wrong position in workspace. Desired Part Position:-1662.975, 133.2, -800.725 Actual Incorrect Position:-2813.166, 133.005, -176.11
Server Script:
local function changeVehiclePosition(vehicleModel, part)
vehicleModel:MoveTo(part.Position)
end
The part is anchored and cancollide is set to false. The part is also raised in the air slightly to ensure vehicles are not sent under the map.
Don’t forget the pivot point is going to change depending on the primary part unless it doesn’t have one then it’s going off the model’s bounding box
local function changeVehiclePosition(vehicleModel, part)
vehicleModel = vehicleModel:GetPivot()
vehicleModel:PivotTo(vehicleModel * CFrame.new(part.Position))
end
Is there something in the way between the start point and the ending point? like terrain or a basepart? If there is its recommended to use Model:SetPrimaryPartCFrame():