local function S(S,Q)local X=#blacklist repeat local y,V=workspace:FindPartOnRayWithIgnoreList(ray(S,Q),blacklist,false,true)if y then if y.CanCollide then eraseFromEnd(blacklist,X)return V,true end blacklist[#blacklist+1]=y end until not y eraseFromEnd(blacklist,X)return S+Q,false end
--------------------------------------------------------------------------------
-- Piercing raycasts

local function getCollisionPoint(origin, dir)
	local originalSize = #blacklist
	repeat
		local hitPart, hitPoint = workspace:FindPartOnRayWithIgnoreList(ray(origin, dir), blacklist, false, true)

		if hitPart then
			if hitPart.CanCollide then
				eraseFromEnd(blacklist, originalSize)
				return hitPoint, true
			end
			blacklist[#blacklist + 1] = hitPart
		end
	until not hitPart

	eraseFromEnd(blacklist, originalSize)
	return origin + dir, false
end
