İm working on a personal project using a helmet camera perspective gameplay based on Sensei_Developer’s Hellmet and Arcsoft’s Project Apex. However adding camera shakes have became an serius issue,

When i add the CFrame for camera shaking, instead of adding a certain angle to CFrame, it constantly rotates the camera itself.
İ tried using different methods. First i used the GGCameraShaker module but it didnt work as i intended and didnt affect the helmet (the helmet is following the camera CFrame)
Lastly i tried taking the camera CFrame and added it independently, but this didnt worked as well.

The exact way i want is to shake the camera without adding up a recoil chance and making the helmet follow the camera.
1 Like
I’m not too great with camera manipulation and the videos won’t load for me, but I think I see the issue
You’re building on camera.CFrame itself every frame, so it already includes last frames bob. The offsets keep stacking, which rotates the camera instead of shaking it. Your recoil line (being camera.CFrame *= CamAimCF * LeaningAgleindex * CFrame Angles(ShootSpring.Position.X, ShootSpring.Position.Y, ShootSpring.Position.Z)) has the same problem
What could fix it is removing last frames offset before the camera updates, then adding the new one after
for example:
RunService:BindToRenderStep("stopShake", Enum.RenderPriority.Camera.Value - 1, function()
camera.CFrame = camera.CFrame * lastOffset:Inverse()
end)
RunService:BindToRenderStep("shake", Enum.RenderPriority.Camera.Value + 1, function(dt)
local target = CamAimCF * LeaningAgleindex * CFrame.Angles(ShootSpring.Position.X, ShootSpring.Position.Y, ShootSpring.Position.Z)
lastOffset = lastOffset:Lerp(target, 1 - 0.01 ^ dt)
camera.CFrame = camera.CFrame * lastOffset
--// update helmet here
end)
1 Like