0

How do I make people face a certain direction when they respawn on a checkpoint?

I finally got my checkpoint script working but when you respawn, you're always facing the same direction. Here is my script:

game.Players.PlayerAdded:Connect(function(plr)
repeat wait() until plr.Character ~= nil
wait(0.01)
local checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value)
char:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(checkpoint.Position + Vector3.new(0,5,0), checkpoint.Position)
char:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(0,0,0)
wait(0.1)
end)
end)



0

[MARK THIS AS ACCEPTED IF THIS WORKS]

You can fix this by first having the correct rotation but not position and then fixing the position.

THE SCRIPT:

game.Players.PlayerAdded:Connect(function(plr)
repeat wait() until plr.Character ~= nil
wait(0.01)
local checkpoint = game.Workspace.Stages:FindFirstChild(stage.Value)
char:FindFirstChild("HumanoidRootPart").CFrame = checkpoint.CFrame
char:FindFirstChild("HumanoidRootPart").Position = Vector3.new(checkpoint.Position.x, checkpoint.Position.y + 5, checkpoint.Position.z)
wait(0.1)
end)
end)

0
Tysm for the help! I accepted the answer because it worked, the character faces the right way now. The only thing is the camera still faces the wrong direction. If there is a way to fix that please let me know, thanks BunjiBloxxer 12 — 16d
0
Nevermind about what I said above, the camera only faces the wrong way when you play in studio, not the actual game. BunjiBloxxer 12 — 14d