Unity how to check distance between two points code example
Example: how to compare distance between 2 objects unity
float distance = Vector3.Distance (object1.transform.position, object2.transform.position);
float distance = Vector3.Distance (object1.transform.position, object2.transform.position);