Rigid Camera Shake

The bobbing above is from hellmet. I need something sort of rigid, and shaky.

  1. I want a rigid camera shake sort of like in body cameras from police officers. I have one already but its super smooth. Body cameras are very shaky and rigid, allowing the player for some good game feel.

  2. I just need help tweaking this code to fix / help me achieve that effect.

  3. **I’ve tried tweaking values before, but none of those work and I don’t seem to understand how to possibly do it. Yes, I did look for solutions, but all of them are smooth camera bobs. **

local bobbing = nil

local function fireBobbing()

	local func1 = 0
	local func2 = 0
	local func3 = 0
	local func4 = 0
	local val = 0
	local val2 = 0
	local int = 10
	local int2 = 10
	local vect3 = Vector3.new()

	local function lerp(a, b, c)
		return a + (b - a) * c
	end

	bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
		if humanoid.MoveDirection.Magnitude > 0 then
			deltaTime = deltaTime * (humanoid.WalkSpeed * 7)
		else
			deltaTime = deltaTime * 5.5
		end

		if humanoid.Health <= 0 then
			bobbing:Disconnect()
			return
		end

		local rootMagnitude = humanoid.RootPart and Vector3.new(humanoid.RootPart.Velocity.X, 0, humanoid.RootPart.Velocity.Z).Magnitude or 0
		local calcRootMagnitude = math.min(rootMagnitude, 100)

		func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 30) / 200) * deltaTime, 0.05 * deltaTime)
		func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 15) / 200) * deltaTime, 0.05 * deltaTime)
		func3 = lerp(func3, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 15) / 200) * deltaTime, 0.05 * deltaTime)
		func4 = lerp(func4, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 15) / 200) * deltaTime, 0.05 * deltaTime)

		camera.CFrame = camera.CFrame * (
			CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3))
				* CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2)
				* CFrame.Angles(math.rad(func4 * deltaTime * (calcRootMagnitude / 20)), 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 20))) --// BOBBING EFFECT
				* CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 30))
		)

		val2 = math.clamp(lerp(val2, -camera.CFrame:VectorToObjectSpace((humanoid.RootPart and humanoid.RootPart.Velocity or Vector3.new()) / math.max(humanoid.WalkSpeed, 0.01)).X * 0.25, 0.5 * deltaTime), -0.35, 0.2)
		func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -15, 15), 0.25 * deltaTime)
		func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)

		if rootMagnitude > 1 then
			val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
		else
			val = lerp(val, 0, 0.05 * deltaTime)
		end

		if rootMagnitude > 12 then
			int = 20
			int2 = 18
		elseif rootMagnitude > 0.1 then
			int = 12
			int2 = 14
		else
			int2 = 0
		end

		vect3 = lerp(vect3, camera.CFrame.LookVector, 0.125 * deltaTime)
	end)
end

fireBobbing()
local function updateOnRespawn()
	bobbing = nil
	character = player.Character
	head = character:WaitForChild("Torso")
	humanoid = character.Humanoid
	createCameraPart()
	fireBobbing()
end
player.CharacterAdded:Connect(updateOnRespawn)

– ignore the ** createCameraPart() **