My goal is to have a method that gets distance to gameObjects Colliders outside boarder - not GameObject position, so that entity can move to that gameobject and stay appropriate distance from it regardless of target gameObjects size.
physics RayCast seems like a great solution for this however I am having trouble casting a ray that ignores all but target gameObject. I am aware its possible to use layers to ignore certain colliders, but this solution will not work for me because the target gameobject shares layer with objects that may obstruct this ray cast.
Please advise me on how to approach this.
Thanks!