Help disable Able to turn camera

I took advice from an old scripting helpers post here, made some modifications to match your use case:

--LocalScript inside StarterCharacterScripts
local RunService = game:GetService("RunService")

local camera = workspace.CurrentCamera

local character = script.Parent 
local head = character:WaitForChild("Head", 5)

--converts degrees to rads, useful for CFrame.Angles
local r = math.rad 

--camera fixed rotation and offset
local rotation = CFrame.Angles(r(0), r(-60), r(0))
local offset = CFrame.new(12, 20, 0)

camera.CameraType = Enum.CameraType.Scriptable

local position = head.Position
RunService.RenderStepped:Connect(function()
	if character and position then
		position = head.Position
		-- Rotate CFrame by rotation value
		local startCFrame = CFrame.new(position)*rotation 
		--Offset CFrame by defined offset
		local cameraPos = startCFrame:ToWorldSpace(offset).Position
		--Set camera properties
		camera.CFrame = CFrame.new(cameraPos, position)
		camera.Focus = CFrame.new(position)
		camera.CameraSubject = head
	end
end)
2 Likes