Check if a ball is inside a circle drawn by a line

I’m new with Unity and I need to know how to check if a ball is inside a circle drawn by a line. I keep the collision points of each point of the line in an array to detect if it goes into collision with the ball, and each point of collision has its X - Y points and I need to know if the user has managed to surround the ball with the line that he has drawn.

If you can help me with a little code I would appreciate it.

Thank you.

Use PolygonCollider2D And OverlapPoint function

  1. Your line game object should have a PolygonCollider2D on it.
  2. Once you detect the circle is complete, change the points of the collider to the X-Y points you have.
  3. Use OverlapPoint function of the collider to detect if key points on the contour of the ball are inside the line’s collider.