MoveTo() Isn't moving model

I want it so when someone buy the car the car moved to a position

local pos = Vector3.new(-38.613, -1.028, -52.513)

Buy.MouseButton1Click:Connect(function()
	local car = workspace.x6m
	car:MoveTo(pos)
	print("Done")
end)

It’s not wokring idk why i tried everything

You will need a Humanoid object in order to use :MoveTo() function.

1 Like

Model:MoveTo() is kinda weird to deal with in my opinion, especially since it involves Model.PrimaryPart to be set up as well as other jazzy stuff.

I highly recommend you use PVInstance:PivotTo to accomplish tasks such as this. You’ll only need the CFrame of the part you want to use as reference when summoning, in your example, a car.

For example:

local ReferenceCFrame = workspace.Reference.CFrame --Where you want to summon your car

Buy.MouseButton1Click:Connect(function()
	local Car = ... --Where your car is located, might want to :Clone() if you have multiple.
	Car:PivotTo(ReferenceCFrame)
	print("Done")
end)
1 Like