FMath::ClosestPointOnSegment

Returns closest point on a segment to a given point.