How do I teleport a Player to a part, but keep the Player's original orientation?

So I am setting the player’s HumanoidRootPart CFrame to the targeted part’s CFrame, but the problem is the part freely spins, so if I set the player’s HumanoidRootPart CFrame to the part’s, it ends up teleporting the player to the part but they are upside down or some other angle.

Using HumanoidRootPart.Position causes a Server to Client Desync.

Is there a way to teleport a player to a part but keep the players original orientation before the teleport?

1 Like

Save the player’s LookVector before teleporting then set it after teleporting.

local LookVector = HumanoidRootPart.CFrame.LookVector
HumanoidRootPart.CFrame.LookVector = LookVector

You can try using

Get the orientation of the player using :ToEulerAnglesXYZ before teleportation

local xRot, yRot, zRot = player.Character.HumanoidRootPart.CFrame:ToEulerAnglesXYZ();

Afterwards, proceed to set their orientation using FromEulerAnglesXYZ

player.Character.HumanoidRootPart.CFrame:FromEulerAngles(xRot, yRot, zRot);