Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I want to teleport a player to a position, but the player is facing the wrong way?

I want to teleport the player to a position (106.668, 1.388, 9.372), but the player is always facing the wrong way. How do I teleport a player to that position whilst also having the player rotate 90 degrees? It is also important to note that the player will be locked in the first person. I have tried the following:

character:SetPrimaryPartCFrame(CFrame.Angles(0, math.rad(-90), 0) * character:GetPrimaryPartCFrame())
rootPart.CFrame = CFrame.new(106.668, 1.388, 9.372)

1 answer

When setting CFrame you need to set its position as a Vector3 value, in addition, the second argument of CFrame is the orientation

ex.

Part.CFrame = CFrame.new(Vector3.new(1,1,1), Vector3.new(5,5,5))

That will move the part to the position, (1,1,1) and the part will be looking at (5,5,5)

This discussion is preserved as it was. New answers, comments, and votes are closed.