unity get coordinates edges of object code example
Example: How to get the world position of the edge of an object?
Vector3 offset = transform.up * (transform.localScale.y / 2f) * -1f;
Vector3 pos = transform.position + offset; //This is the position