public static void ShrinkRaycast(Raycast raycast, byte[,] obstacles) { for (int i = 0; i < raycast.Count; i++) { if (obstacles[raycast[i].X, raycast[i].Y] == 255) { raycast.CutEnd(i); } } }