-- This function casts a ray with a blacklist.

local function CastWithBlacklist(origin, direction, blacklist, ignoreWater)
	if not blacklist or typeof(blacklist) ~= "table" then
		-- This array is faulty
		error("Call in CastBlacklist failed! Blacklist table is either nil, or is not actually a table.", 0)
	end
	local castRay = Ray.new(origin, direction)
	return Workspace:FindPartOnRayWithIgnoreList(castRay, blacklist, false, ignoreWater)
end
