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

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) * 0.5
		local bobbleY = math.abs(math.sin(currentTime * 5.6)) * 0.5

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

runService.RenderStepped:Connect(updateBobbleEffect)
