How to get the world position of the edge of an object?

2 Answers

2

Assuming that gameobject’s parent isn’t scaled, you should be able to do something like this (Untested):

Vector3 offset = transform.up * (transform.localScale.y / 2f) * -1f;
Vector3 pos = transform.position + offset; //This is the position

transform.position + transform.right * -transform.localScale / 2