Need help with script / possible bug

Edit - Please Note
The issue occurs with PivotTo, as It is moving it as swell as rotating it.

Issue
When the clickdetector is clicked, the position of “Tram”…Player.Name gets changed significantly, and it also rotates. I have no idea why. I want just the orientation to change.

Script

local newCF = CFrame.Angles(0, 0, 0)
function Click(Player)
	workspace:FindFirstChild("Tram"..Player.Name):PivotTo(newCF)
	if Player.Character then
		wait(1)
		Player.Character:WaitForChild("HumanoidRootPart").Position = workspace:FindFirstChild("Tram"..Player.Name).One.VehicleSeat.Position
	end
end

script.Parent.ClickDetector.MouseClick:Connect(Click)
1 Like

Because your setting it to a blank cframe at 0,0,0 with rotation 0,0,0.

1 Like

Where ‘should’ the tram appear when the clickdetector is clicked?

It should rotate 90 degrees, which would be the orientation of 0,0,0.

Is there a way I can make just the orientation change?

Player.Character:MoveTo(workspace:FindFirstChild("Tram"..Player.Name).One.VehicleSeat.Position)
1 Like

It still teleports across the map and rotates, not just rotating.