Screen not shaking when it should shake

Hello, I’ve been working on a game recently and there has been issues within Studio and the Roblox client. This script worked perfectly fine until recently - it made the camera shake, as it was supposed to. However, it fails to do so now.

Every script manipulating a player’s camera using camera.CFrame does not work. Everything is done locally, maybe it’s a Roblox update? I’ve tried rewriting some stuff, but it has the same result.

A lot of my scripts use this specific function, would be cool if I could make my game chaotic again.

All help is appreciated!

function ShakeCamera()
	if Module.CameraShakingEnabled then --this is true by the way
		local Intensity = Module.Intensity/(AimDown and Module.MouseSensitive or 1)
		for i = 1, 10 do
			local cam_rot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
			local cam_scroll = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
			local ncf = CFrame.new(Camera.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ((-Intensity+(math.random()*(Intensity*2)))/100, (-Intensity+(math.random()*(Intensity*2)))/100, 0)
			Camera.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
			task.wait()
		end
	end
end
1 Like

All the variables are defined, this is just a snippet

Have you tried using modules like EZCameraShake? I recommend it, really really smooth.