CFrame problem on first person mode when teleporting

I created a teleport script with the CFrame of part-destination, It works on third-person view but not working on first person view.

Proof:

Third person
1
2

First Person:


4

As you can see the part-destination have a hinge and it positioned on the front surface of it.

Have you tried changing the camera’s orientation?

1 Like

Can you teach me how? because I am still learning in Lua Programming.

Could you show us the code you used?

When changing any property of the camera, you want to do it on the Client’s side, therefore you must use a Local Script.
You can get the CurrentCamera, which is the camera the client is currently viewing from, by getting workspace.CurrentCamera
To change it’s orienation you simply modify it CFrame

workspace.CurrentCamera.CFrame = NEW CFRAME

So I use a Remote Function but this is the overall script that handles the teleportation.

FadeEvent.OnServerInvoke = function(player, Lplayer, key)
	if player and key == "chamber" then
		Lplayer.Character.HumanoidRootPart.CFrame = game.Workspace:WaitForChild("qwer").CFrame + Vector3.new(0,3,0)
	end
end

If I change the CFrame of it, does the position of the camera will change too? I would like to change the orientation only.

Well CFrame is short for CoordinateFrame and includes both Position and Orientation, but if you create a new CFrame, using the camera’s position and your desired orientation, the camera would only rotate, and not move.

How can I achieve those? can you please tell me how?

Try whit .Position and .Orientation instead of the .CFrame.