Find closest point of one object

That is basically it. I need to find the closest point in one object’s mesh or collider, to another one (or: the closest point of a mesh to a second point in a certain radius).

25319-point.png

I have tried some approaches but fail. I tried creating a “trigger” CirlceCollider, then get the collisions with other colliders, but that only gives me the points were the colliders intersect. There may be simple way to do this but I’ve search and think for two days and I just can’t figure this one out.
Any help would be very appreciated.

EDIT: Re-uploaded the image.

Answer Is In Your Question Where U draw Circle.
In Unity Using Physics.SphereCastAll Returns All The RaycastHit In Array
From(RaycastHit array) That You Can Find Min Distance Hit Point.

Like Example

RaycastHit GetMinDistancePoint()
{
RaycastHit points = Physics.SphereCastAll(transform.position, 10, transform.forward);
float minDist = 100;
RaycastHit selectionPoint;
foreach (RaycastHit hit in points)
{
if (hit.distance < minDist)
{
minDist = hit.distance;
selectionPoint = hit;
}
}
return selectionPoint;
}

Hey, I realise this is over a year old now so I don’t expect I’m adding anything of use really, but I was looking for an answer to the same question and eventually came across this:

This should give you a point on the bounding box, which you could then raycast towards to find the actual hit position. Still wouldn’t be EXACTLY accurate but would be a closer approximation I think.

Had the same question years after the question, came here, my updated answers (2020) are below.

Use “Physics.ClosestPoint” (gives closest point on a colider as asked in the question) or in some cases “Physics.ComputePenetration” and find the location from the penetration direction, while making the first object a small sphere.