CFrame the character and orient them a certain direction

I’m working on an obby game and in my respawn function I have the code below that teleports the new character to the checkpoint. Is there a better way to make the character face the same direction the checkpoint is facing?

-- Teleport player to checkpoint and face them the same direction the checkpoint is facing --
character.Head.CFrame = (checkpoint.CFrame * CFrame.new(0, 4, 0)) * CFrame.Angles(
	math.rad(checkpoint.Orientation.X),
	math.rad(checkpoint.Orientation.Y + 90), -- Positive 90 for the forward direction
	math.rad(checkpoint.Orientation.Z)
);

If you make the checkpoint’s front face the way you want it to point, you can just set the character’s humanoid root part cframe to the check point’s cframe and offset upwards and you won’t need to change any angles:

1 Like