# RaycastHit2D.point is acting weird when used with circlecast2d

When I make circleCast2d intersects with another circle collider, I get a RaycastHit2D.point that doesn't point at the tip of the collision as it states in the documentation. Instead it always points at the centre of the intersected junction or pointC as shown in the figure below.

I checked this numerous times with different values to make sure the error was not from my end.

Is this intended? If so is there another way where I can actually find the closest point from collider(B) to the centre of collider(A) which corresponds to point(D) in the figure?

This is a picture of what looks like:

A = circleCast
B = collided object
C = where RaycastHit2D.point is pointing at
D = where I'd like it to point.

• Can you show us your CircleCast2D code that produces this result? It looks like you're firing a circle from a position where it already overlaps, so there is no point of collision, and the middle of the overlapping region is the best value the physics engine can provide you in that case. Did you want Physics2D.OverlapCircle, Collider2D.OverlapCollider, or Collider2D.ClosestPoint instead? – DMGregory Mar 19 at 16:02
• @DMGregory thank you Collider2D.ClosestPoint did the exact thing I wanted. for a while, unity kept saying that "collider2d doesn't have a function called ClosestPoint". turns out I was still using 2018 build and they only added it in later updates. again thank you – alqaadi Mar 20 at 10:02
• This answer (and your question) would be clearer if you showed a sample of the code you're using, not just the name of the method. I can tell you that RaycastHit2D is not "misbehaving," but you may have been misusing it. Without seeing your code though, we can't help you find the problem in your code and explain what you did wrong. – DMGregory Mar 20 at 18:43