So, I was running a few tests with Physics.ComputePenetration and Overlap functions, mainly for making custom collision detection and noticed something. Why does Overlap functions return True when colliders are really close but not touching? My basic setup was to create a CapsuleCollider and a BoxCollider. The capsule would move against the box and fix the collision. Then, right after that, the object with the box collider would run their Update and check for anything that might be overlapping. This was done setting the order of the scripts in the Script Execution Order settings. Turns out the Capsule was overlapping anyway. This is the depenetration Update: Code (CSharp): void Update() { transform.position += transform.forward * Time.deltaTime * 2f; var n = PhysicsExtensions.OverlapCapsuleNonAlloc(capsule, colliders, layerMask); for (int i = 0; i < n; i++) { var collider = colliders[i]; if (Physics.ComputePenetration(capsule, transform.position, transform.rotation, collider, collider.transform.position, collider.transform.rotation, out penetrationDir, out penetrationDist)) { transform.position += penetrationDir * penetrationDist; } } } And this is one from the box (named Wall in the demo): Code (CSharp): void Update() { c_count = PhysicsExtensions.OverlapBoxNonAlloc(boxCollider, overlapColliders, playerLayer, QueryTriggerInteraction.Ignore); } I set them up with different layers in order to avoid any confusion. If anyone wants to test it, here is the link: https://1drv.ms/u/s!AhuKiONNB5NIh8RJVYAv9FHV14xmTg
Possibly it has to do with the "contact offset" properties in the colliders: https://docs.unity3d.com/ScriptReference/Physics-defaultContactOffset.html https://docs.unity3d.com/ScriptReference/Collider-contactOffset.html