local u={}u.__index=u local t=require(script:WaitForChild("\083\109\111\111\116\104\068\097\109\112"))function u.new(P,U)assert(typeof(P)=="\086\101\099\116\111\114\051","\105\110\105\116\105\097\108\086\097\108\117\101 \115\104\111\117\108\100 \098\101 \086\101\099\116\111\114\051")assert(typeof(U)=="\110\117\109\098\101\114","\115\109\111\111\116\104\084\105\109\101 \115\104\111\117\108\100 \098\101 \097 \110\117\109\098\101\114")assert(U>=0,"\115\109\111\111\116\104\084\105\109\101 \109\117\115\116 \098\101 \097 \112\111\115\105\116\105\118\101 \110\117\109\098\101\114")local b=setmetatable({Value=P;Goal=P;SmoothTime=U},u)b._smoothDamp=t.new()return b end function u.Update(t,u)if u then t.Goal=u else u=t.Goal end local P=t._smoothDamp:Update(t.Value,u,t.SmoothTime)t.Value=P return P end function u.UpdateAngle(t,u)if u then t.Goal=u else u=t.Goal end local P=t._smoothDamp:UpdateAngle(t.Value,u,t.SmoothTime)t.Value=P return P end function u.SetMaxSpeed(t,u)t._smoothDamp.MaxSpeed=u end function u.GetMaxSpeed(u)return u._smoothDamp.MaxSpeed end return u




local Smooth = {}
Smooth.__index = Smooth

local SmoothDamp = require(script:WaitForChild("SmoothDamp"))


function Smooth.new(initialValue, smoothTime)

	assert(typeof(initialValue) == "Vector3", "initialValue should be Vector3")
	assert(typeof(smoothTime) == "number", "smoothTime should be a number")
	assert(smoothTime >= 0, "smoothTime must be a positive number")
	
	local self = setmetatable({
		Value = initialValue;
		Goal = initialValue;
		SmoothTime = smoothTime;
	}, Smooth)
	
	self._smoothDamp = SmoothDamp.new()
	
	return self
	
end


function Smooth:Update(goal)
	if (goal) then
		self.Goal = goal
	else
		goal = self.Goal
	end
	local value = self._smoothDamp:Update(self.Value, goal, self.SmoothTime)
	self.Value = value
	return value
end


function Smooth:UpdateAngle(goal)
	if (goal) then
		self.Goal = goal
	else
		goal = self.Goal
	end
	local value = self._smoothDamp:UpdateAngle(self.Value, goal, self.SmoothTime)
	self.Value = value
	return value
end


function Smooth:SetMaxSpeed(speed)
	self._smoothDamp.MaxSpeed = speed
end


function Smooth:GetMaxSpeed()
	return self._smoothDamp.MaxSpeed
end


return Smooth
