How do you rotate the camera 180 degrees

So I made two portals that let you teleport between each other. However, the problem is that they face different directions so when you arrive at one portal, you’re looking in the same direction from when you entered the first portal.

I tried this solution to fix it but it just doesn’t work for the camera, returning errors like “Position is not a valid member of workspace.Camera”

Any advice on how to rotate the camera to the opposite direction would be appreciated.

1 Like

You could try this

workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.Angles(math.rad(180), 0, 0)
2 Likes

bruh what I tried so many complicated methods only to realize this would work. I thought rotating the Camera’s CFrame would just rotate it on the spot. Thanks though!

Btw you should probably use humanoidrootpart.LookVector, because this will just rotate the camera 180 degrees and doesn’t check which angle it actually is meaning if your camera is facing down it will go up

workspace.CurrentCamera.CFrame = CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.LookVector)
1 Like