-- put in: StarterPlayer > StarterCharacterScript


local char = script.Parent

local human = char:FindFirstChildOfClass("Humanoid") or char:WaitForChild("Humanoid")
local cam = workspace.CurrentCamera
local humspeed = 0

if not human then
	return
end

human.Running:Connect(function(sp)
	humspeed = sp
end)

game:GetService("RunService").RenderStepped:Connect(function()
	local ticked = tick()
	if human.MoveDirection.Magnitude > 0 then
		cam.CFrame = cam.CFrame:Lerp(cam.CFrame * CFrame.Angles(math.rad(math.sin(ticked * humspeed) * 1), math.rad(math.sin(ticked * humspeed)), math.rad(math.sin(ticked * humspeed) * 2)), humspeed / 100)
	else
		cam.CFrame = cam.CFrame:Lerp(cam.CFrame * CFrame.Angles(math.rad(math.sin(ticked * 1) * 0.90), 0, 0), 0.0)
	end
end)
