local Z=game:GetService("\082\117\110\083\101\114\118\105\099\101")local H=script.Parent local S=H:WaitForChild("\072\117\109\097\110\111\105\100")function updateBobbleEffect()local Z=tick()if S.MoveDirection.Magnitude>0 then local H=math.cos(Z*10)*.25 local w=math.abs(math.sin(Z*10))*.25 local e=Vector3.new(H,w,0)S.CameraOffset=S.CameraOffset:lerp(e,.25)else S.CameraOffset=S.CameraOffset*.75 end end Z.RenderStepped:Connect(updateBobbleEffect)
--Camera bobbing
-- Shakes the camera when the player is walking

local runService = game:GetService("RunService")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

function updateBobbleEffect()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then
		local bobbleX = math.cos(currentTime * 10) * 0.25
		local bobbleY = math.abs(math.sin(currentTime * 10)) * 0.25

		local bobble = Vector3.new(bobbleX, bobbleY, 0)

		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, 0.25)
	else
		humanoid.CameraOffset = humanoid.CameraOffset * 0.75
	end
end

runService.RenderStepped:Connect(updateBobbleEffect)
