local z=game:GetService("\082\117\110\083\101\114\118\105\099\101")local y=script.Parent local H=y:WaitForChild("\072\117\109\097\110\111\105\100")local d=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")function updateBobbleEffect()local z=tick()if H.MoveDirection.Magnitude>0 then local y=math.cos(z*5.6)*.5 local m=math.abs(math.sin(z*5.6))*.5 local X=Vector3.new(y,m,-0.45);(d:Create(H,TweenInfo.new(.1),{CameraOffset=H.CameraOffset:lerp(X,.35)})):Play()else(d:Create(H,TweenInfo.new(.1),{CameraOffset=Vector3.new(0,0,-0.45)})):Play()end end z.RenderStepped:Connect(updateBobbleEffect)


local runService = game:GetService("RunService")

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local TS = game:GetService("TweenService")

function updateBobbleEffect()
	local currentTime = tick()
	if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
		local bobbleX = math.cos(currentTime * 5.6) * .5
		local bobbleY = math.abs(math.sin(currentTime * 5.6)) * .5

		local bobble = Vector3.new(bobbleX, bobbleY, -.45)
		TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = humanoid.CameraOffset:lerp(bobble, .35)}):Play()
	else -- we are not walking
		TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = Vector3.new(0, 0, -.45)}):Play()
	end
end


runService.RenderStepped:Connect(updateBobbleEffect)
