Finding object's distance inside another object with collisions disabled.

I have a pan and I am looking to find how far into another object my object is. I know I can use collider2d.distance Unity - Scripting API: Collider2D.Distance but that only returns a value if I don’t have the collision disabled. How would I find a way to find a 2D object’s distance inside another 2D object with collisions disabled?

Does using Vector3.Distance() to compare the centers of the object and see how that distance compares to their size help you at all?

1 Like

It seems to be working. Thank you.

1 Like