Changing Camera Rotation without Changing Position

I’m trying to remake the roblox studio camera for a game that I’m making, I have the movement working and the camera sorta working, when I use the camera it’s not right I cant really explain it but it looks very realistic and not like roblox studio’s camera. I can get the camera working normally but then the movement gets messed up because it changes the CFrame’s position and not just the rotation.

Try using the code and put the camera type to scriptable to see what I’m talking about.

If you can help with this issue that would be amazing,

instead of multiplying the CFrame by CFrame.Angles(...), why don’t you just do Cam.CFrame = CFrame.new(cam.CFrame.Position, Vector3.new(LookAt.X, LookAt.Y, 0)). CFrame.new(pos, lookat) is an overload of CFrame.new() that orientates the CFrame to ‘look-at’ a position. See: CFrame | Roblox Creator Documentation

Thanks!
local Players = game:GetService(“Players”)
local StarterGui = game:GetService(“StarterGui”)
local UserInputService = game:GetService(“UserInputService”)

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hum = character:WaitForChild(“Humanoid”)
local torso = character:WaitForChild(“Torso”)
local head = character:WaitForChild(“Head”)
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera

local torsoCF = CFrame.new(torso.Position)
local rootCF = CFrame.new(torso.Position)
local cameraCF = CFrame.new(head.Position)
local humCF = hum:GetPropertyChangedSignal(“CameraOffset”)
local humCF2 = hum:GetPropertyChangedSignal(“CameraOffset”)
local humCF3 = hum:GetPropertyChangedSignal(“CameraOffset”)
local humCF4 = hum:GetPropertyChangedSignal(“CameraOffset”)
local humCF5 = hum:GetPropertyChangedSignal(“CameraOffset”)

hum.WalkSpeed = 1
hum.JumpPower = 1

local lastCF = nil
local lastCF2 = nil
local lastCF3 = nil
local lastCF4 = nil
local lastCF5 = nil

function onCameraOffsetChange(newValue)
if lastCF ~= newValue then
cameraCF = cameraCF * CFrame.new(newValue)
lastCF = newValue
end
end

function onCameraOffsetChange2(newValue)
if lastCF2 ~= newValue then
cameraCF = cameraCF * CFrame.new(newValue)
lastCF2 = newValue
end
end

function onCameraOffsetChange3(newValue)
if lastCF3 ~= newValue then
cameraCF = cameraCF * CFrame.new(newValue)
lastCF3 = newValue
end
end

function onCameraOffsetChange4(newValue)
if lastCF4 ~= newValue then
cameraCF = cameraCF * CFrame.new(newValue)