(treat this as a comment ı don't have 50+ reputation) ı was using gizmos for debugging raycasts it is good to visually see the rays, make it change color based on some conditions etc.
Gizmos.DrawLine(transform.position, target.position);