According to this post , it looks like 2D colliders really need to have a variable of missing borders, and it will be available in a future version.
So it looks now, now you have to get around the workaround. You can add the Sprite Renderer component to your GameObject, add a dummy image to it, and disable it so that it is never visible. Then you can use gameObject.renderer.bounds to get the borders of the sprites.
source share