function OrientableBody.useAttributeAsSource(X)X:orientFromAttribute()X.attributeConnection=(X.character:GetAttributeChangedSignal(ATTRIBUTE)):Connect(function()X:orientFromAttribute()end)end function OrientableBody.destroy(X)if X.attributeConnection then X.attributeConnection:Disconnect()X.attributeConnection=nil end if X.renderStepConnection then X.renderStepConnection:Disconnect()X.renderStepConnection=nil end X.motor:setGoal({horizontalAngle=Otter.spring(0),verticalAngle=Otter.spring(0)})X.motor:onComplete(function()if X.motor then X.motor:destroy()X.motor=nil end end)end return OrientableBody

function OrientableBody:useAttributeAsSource()
	self:orientFromAttribute()
	self.attributeConnection = self.character:GetAttributeChangedSignal(ATTRIBUTE):Connect(function()
		self:orientFromAttribute()
	end)
end

function OrientableBody:destroy()
	if self.attributeConnection then
		self.attributeConnection:Disconnect()
		self.attributeConnection = nil
	end
	if self.renderStepConnection then
		self.renderStepConnection:Disconnect()
		self.renderStepConnection = nil
	end

	self.motor:setGoal({
		horizontalAngle = Otter.spring(0),
		verticalAngle = Otter.spring(0),
	})

	self.motor:onComplete(function()
		if self.motor then
			self.motor:destroy()
			self.motor = nil
		end
	end)
end

return OrientableBody
