Camera not facing the correct direction of Part when teleport

When teleporting the player the camera is not facing the correct direction.

Player is facing the correct direction(that is the Front of the part) but the camera itself is not facing the correct direction:

How it should look like:

Code:

--Server Side
--Services
local players = game:GetService("Players")

function TeleportPlayerToCheckpoint(player)
	local Character = player.Character
	local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")


	HumanoidRootPart.CFrame = workspace.TestPart.CFrame + Vector3.new(0,1,0)
end


players.PlayerAdded:Connect(function(player)
	wait(3)
	TeleportPlayerToCheckpoint(player)
end)

Do I have to manipulate the camera to fix this?

.
Edit
Done more testing and I am a bit confused as

When I run it Client Side in the StarterCharacter it teleport the player and the camera orientation is correct but there will be one off’s that it won’t be orientated correctly.

local player = game.Players.LocalPlayer

function TeleportPlayerToCheckpoint(player)
	local Character = player.Character
	local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")

	HumanoidRootPart.CFrame = workspace.TestPart.CFrame + Vector3.new(0,1,0)
	local camera = workspace.CurrentCamera
end

TeleportPlayerToCheckpoint(player)

To test it further on the client I added a wait(1) when I done so the orientation of the camera was incorrect

local player = game.Players.LocalPlayer

function TeleportPlayerToCheckpoint(player)
	local Character = player.Character
	local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")

	HumanoidRootPart.CFrame = workspace.TestPart.CFrame + Vector3.new(0,1,0)
	local camera = workspace.CurrentCamera
end

wait(1) --When the wait is here the camera orientation will be incorrect
TeleportPlayerToCheckpoint(player)

And with the Server having a delay it will act as if it is acting on the client side with the wait(1) leading the orientation incorrectly. On the server at times the orientation is correct but 9 times out of 10 it will be incorrect

I am not sure if this is because of the axes being set for the camera before teleporting or if it is Engine Bug.

Place to test it out yourself:
NotFacingRightDirection.rbxl (27.3 KB)

yeah, just set the cameras CFrame to the players head CFrame.lookvector. So something like:

local offset = vector3.new(0, 0, 5)
Camera.CFrame = Character.Head.CFrame + offset

then add a offset so your not first person

Set the camera’s cframe to behind the head. You’ll have to use the client to manipulate the camera since this is a server script.

local camera = workspace.CurrentCamera
camera.CFrame = character.Head.CFrame * CFrame.new(0, 3, 5) --Positive on the Z axis is backwards, up a bit
camera.CFrame = CFrame.lookAt(camera.CFrame.Position, character.Head.Position)--Now that the camera is up, make it look at the head