--	print("Punch Swing")

	self.animation.states["Punch"].swing()
	
	self.collisionDetect.CFrame = Punch.character.PrimaryPart.CFrame * CFrame.new(0, 0, (-self.collisionDetect.Size.Z / 2)+1)
	self.collisionDetect.Parent = Punch.character -- change this to a folder

	local touchedParts = self.collisionDetect:GetTouchingParts()
	
	self.collisionDetect.Parent = nil
	
	local curated = {}
	for  _,Part in next, touchedParts  do
		if not(Part:IsDescendantOf(self.character) or Part ==  workspace.Terrain) then
			curated[#curated + 1] = Part
		end
	end
	
	if #curated >= 1 then
		Rep.Relay.SwingTool:FireServer(curated)
	end
	
	curated = {}
end

function Punch:input(inputName,inputState,inputObject)
	if inputName == "Action" then
		if inputState == Enum.UserInputState.Begin then
			self.holding = true
			if (Rep.Constants.RelativeTime.Value - _G.SD[player.UserId].Data.tempData.lastAction) > 0.25 then
				_G.SD[player.UserId].Data.tempData.lastAction = Rep.Constants.RelativeTime.Value
				swing(self)
			end
		elseif inputState == Enum.UserInputState.End then
			self.holding = false
		end
	end
end

function Punch:step(dt)
	if self.holding then
		if (Rep.Constants.RelativeTime.Value - _G.SD[player.UserId].Data.tempData.lastAction) > 0.3 then -- 0.3 to make holding slightly slower
			_G.SD[player.UserId].Data.tempData.lastAction = Rep.Constants.RelativeTime.Value
			swing(self)
		end
	end
end

return Punch
