local function V(V,y)local A=#blacklist repeat local j,a=workspace:FindPartOnRayWithIgnoreList(ray(V,y),blacklist,false,true)if j then if j.CanCollide then eraseFromEnd(blacklist,A)return a,true end blacklist[#blacklist+1]=j end until not j eraseFromEnd(blacklist,A)return V+y,false end


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
