How do I lock the camera?

Hey everyone, so essentially what I want to do is make it so that the camera of the character is always behind them. Meaning they can’t rotate it to view their sides or their face or anything else but their back. Also when they turn right or left the camera rotates to their back accorindingly. How would I do that?

1 Like

Turn the camera to scriptable:
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

Create a RunService.RenderStep to update the camera CFrame to be oriented to the HRP of the player keeping a slight offset behind it

1 Like

When I try to change the camera orientation it says that “Orientation is not a valid member of camera.CFrame”

thats because its non-existent and only the properties display such properties. you need to reconstruct the cframe

local newCF = camera.CFrame * CFrame.Angles(0, 90, 0) -- rotate yaw by 90 degrees
1 Like

You are working with the CFrame of the camera, which is a matrix of coordinates that includes position and rotation. What Artzified did show you its right.

But, what you should do inside the RenderStep is to get the CFrame of the HRP or head or any part you like from the Player, and use that CFrame to update the camera, and just add a slight offset on Z and Y axis position of the CFrame

1 Like

Ok I’ll try this and see how it goes, I’m likely gonna be coming back for help because CFrames confuse me haha.

1 Like

Ohhhhh okay that helps a lot lol thanks

1 Like