//it finds the closer vertex to it public Vector3 FindClosestVertex(Vector3 to, Vector3[] verticesP, float epsilon = 0.01f) { List <float> distances = UMath.ReturnDistances(verticesP, to); List <int> minimosIndex = UMath.ReturnTheIndexes(distances, 1, epsilon); return(verticesP[minimosIndex[0]]); }