CFrame is not CFraming

hello, im am trying to achieve the current camera CFrame slightly copy the local player heads CFrame. i dont understand what i am doing wrong.

local human = script.Parent:WaitForChild(“Humanoid”);
local ccamera = workspace.CurrentCamera;

local head = script.Parent:WaitForChild(“Head”);
if head then
local v4 = head.CFrame:ToObjectSpace(script.Parent:WaitForChild(“Torso”).CFrame);
if Old_CFrame then
local v37 = nil;
local v38 = nil;
local v39 = nil;
local v40 = nil;
local v41 = nil;
v1, v2, v3 = v4:ToOrientation();
local v4 = nil;
v5, v6, v7v = v4:ToObjectSpace(Old_CFrame):ToEulerAnglesXYZ();
if human.WalkSpeed < 24 then
ccamera.CFrame = ccamera.CFrame * CFrame.Angles(v37 / 15, v38 / 15, -v39 / 15);
else
ccamera.CFrame = ccamera.CFrame * CFrame.Angles(v37 / 30, v38 / 30, -v39 / 30);
end;
end;
Old_CFrame = v4;
else
ccamera.CFrame = ccamera.CFrame * CFrame.Angles(0, 0, 0);
end;

uhhhh

Camera.CFrame = CFrame.LookAlong(Camera.CFrame.Position, Head.CFrame.LookVector)

that doesnt work either and i want it to slightly copy the movement not a whole lot

you could dampen the Head.CFrame.LookVector probably, im having trouble visualizing what it is that you want so i cant help much

1 Like

camera CFrame slightly copy the players head is what im trying to achieve.

Did you unobfuscate this code or something lol what’s up with the variables

You can’t just write to game.Workspace.CurrentCamera.CFrame and expect it to work unless you’ve disabled Roblox’s PlayerScripts camera code by setting the camera type to Scriptable. Otherwise the default camera scripts are still going to set the camera CFrame every renderstep, and overwrite whatever you’re doing. In modes other than Scriptable, the camera is also not fully unlocked to point in any arbitrary direction, you may see it resist z-axis roll.