I have been trying to find documentation shows the math behind the “Collider.ClosestPointOnBounds” method, but I have not been able to find anything.
Have you guys seen anything related to this???
It is quite easy to calculate. You can just clamp the point to min and max of the bounding box.
See here:
Game Physics Cookbook