:PivotTo() moving pivot, not model

I want to make a button that resets a car that the player is driving. It is getting the correct model, and it seems to be working, but the model does not move to its pivot, instead the pivot gets moved to where I want it to, but not the car.
It is important to note that the script does work for the first time it is called. But every subsequent time it looks like this:


Its also worth stating that the model clips into the ground when it is moved, if that shifts it for some reason.

local already=false
game.ReplicatedStorage.Redoer.OnServerEvent:Connect(function(player,model)
	print(model)
	if not already then
		already=true
	local Cframe=model:GetPivot()
	
	model:PivotTo(CFrame.new(0,0,0))
	
	--model:PivotTo(CFrame.new(Cframe.Position.X,Cframe.Position.Y+10,Cframe.Position.Z))
		wait(1)
		already=false
		print("b")
	end
end)

Why is :PivotTo() behaving like this? And how do I get it to move the model?

1 Like

Did you set the primary part of your model?

try setting the primarypart of your model and weldconstrainting every part to it

:PivotTo() shouldn’t work weirdly anymore

1 Like

Yes, setting the primary part does work, but now I need to make the player move with the car, as currently if the car gets reset, the player gets kicked out. It should not take too much time or effort as I assume I can weldconstrain them together or get the seatweld to not break.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.