Finding Position based on a local perspective

I need to find the relative location of an object based on a GameObject’s local perspective.
Best way i could think to describe it was a crude example pic :slight_smile:

I need to be able to tell the circle (which could be anywhere in the world space) if the triangle is to the left or right of the square based on where the circle is. Again, the circle can be in any location at any time, so it needs to be somewhat dynamic.

I dont need any help with writing the scripts, just on how to get this info from the Unity engine. If this has a name or documentation I would be happy with just a link for an answer.

Thanks in advance to anyone who can point me in the right direction!

alt text

Yes, it has a name in the Unity engine- you should read up on your documentation before asking questions as simple as this.

Use

transform.InverseTransformPoint(otherPosition);

to get the otherPosition relative to the transform.