Surprisingly, Collider2DRaycastFilter still works perfectly in 2025 for Unity 6 and there's still need for that.