Distance between two colliders UNITY2D

Hello guys!
i have a question, im trying to find the distance between two colliders, i tried with Vector3.Distance but this calculate the distance between Pivots, i need the entire collison.
why i need this? Because im trying to delete one object if is to close to another object (another boxcollider)

I hope u can understand, English is not my mother language
Thanks!

7122476--850517--problem.png

1 Like

You can use Physics2D.Distance for this.

3 Likes

Thanks you!! It works!