RunService.RenderStepped:Connect(function()local m=tick()if humanoid.MoveDirection.Magnitude>0 then local o=math.cos(m*10)*.15 local j=math.abs(math.sin(m*10))*.3 local h=Vector3.new(o,j,0)humanoid.CameraOffset=humanoid.CameraOffset:lerp(h,.25)else local m=tick()local o=math.cos(m*speed)*intensity local j=math.sin(m*speed)*intensity local h=CFrame.new(Vector3.new(o,j,0),Vector3.new(o*.95,j*.95,-10))+camera.CFrame.Position camera.CFrame=camera.CFrame:Lerp(h*camera.CFrame.Rotation,smoothness)end end)


RunService.RenderStepped:Connect(function()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
		local bobbleX = math.cos(currentTime * 10) * .15
		local bobbleY = math.abs(math.sin(currentTime * 10)) * .30

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

		humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
	else -- we are not walking
		local t = tick()
		local x = math.cos(t * speed) * intensity
		local y = math.sin(t * speed) * intensity

		local cf = CFrame.new(Vector3.new(x, y, 0), Vector3.new(x*0.95, y*0.95, -10)) + camera.CFrame.Position

		camera.CFrame = camera.CFrame:Lerp(cf * camera.CFrame.Rotation, smoothness)	
	end
end)
