Physics2D.OverlapBox seems inaccurate

In the attached image you can see (on a really blurry, placeholder sprite):
A green ground checker, a red and blue wall checker, and 2 small “slope” checkers (blue and red).

The parameters used to Debug.DrawCube/Sphere these are the same parameters I use to do the OverlapBox/Circle checks.

As you can also see I’ve shrunk this box much smaller than the collider (for testing proposes) BUT the overlap checks for both ground (green) and wall (red and blue boxes to the sides) detect the ground (beneath Mario’s feet) even sitting this far from the ground… Why is this?

Code used:

    public bool WalledCheckRight(){
        return Physics2D.OverlapBox(wallCheckRightOriginV3,wallCheckRightSizeV3,0, wallMask);
    }

    public bool WalledCheckLeft(){
        return Physics2D.OverlapBox(wallCheckLeftOriginV3,wallCheckLeftSizeV3,0, wallMask);
    }

    public bool GroundCheck(){
        var rightCol = Physics2D.OverlapCircle(groundRightV3, groundCheckSize, floorMask);
        var leftCol = Physics2D.OverlapCircle(groundLeftV3, groundCheckSize, floorMask);
        var ground = (rightCol || leftCol) || Physics2D.OverlapBox(groundmiddleOriginV3, groundmiddleSizeV3, 0, floorMask);
        onSlope = rightCol ^ leftCol;
        return ground || onSlope;
    }




Sorry the inline image failed, and it seems to have uploaded the image… 4 times.
But those attached images are the same as the inline one was supposed to be.

Sorry but I don’t follow your images or your color keying here. Note that polygon collisions have an inherent separation that’s counted as a collision as controlled by Physics2D.minPenetrationForPenalty (soon to be renamed to Physics2D.defaultContactOffset). You can read the info there.

You can change this sepatation in the Physics2D settings but it’s part of Box2D and will cause less accurate collisions if you do so. Whilst it may be tempting to set it to zero, the problem is that you’re viewing at a very small scale as this separation defaults to 0.01 (1cm).

All physics queries that involve polygons will use this as it’s a built-in part of the 2D physics system. Let a polygon fall onto a surface, the separation will be the same as the query. Circles don’t use this separation.

Note that in 5.6-beta, a new ContactFilter2D was introduced. This can be used on all physics queries (casts, overlaps, IsTouching etc). This allows you to perform simple checks like asking if the (say) Capsule overlaps but only return the within a specific angle range such as left, below & right etc.