Hello everyone, I’ve been making a car spawned lately and have managed to extract cars from ServerStorage to MoveTo() a part’s position using the Primary part.
Although I have managed to move the car to the part’s position, I would also like to rotate it to match the part’s rotation. I thought maybe PivotTo() would help as their names seemed similar, so tried but failed. I didn’t use CFrame because it would depend on how the “relative rotation” - if we can say that - between the model and the part.
How can I set the model’s rotation to match the one of the part?
local part = ...
model:PivotTo(part.CFrame)
Also here is the code I’ve got so far:
script.Parent.ClickDetector.MouseClick:Connect(function()
local car = game:GetService("ServerStorage").Formula1:WaitForChild(script.Parent.Parent.Team.Value):Clone()
car.Parent = game.Workspace["MWR F1 2022"]
car.PrimaryPart = car:WaitForChild("DriveSeat")
car:MakeJoints()
car:MoveTo(script.Parent.Parent.SpawnLocation.Position)
car.PrimaryPart = car.Wheels.FR
end)
Oh… Is it really that simple? In that case, sorry for wasting your time
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.