Snapping to an Edge
After detecting a collision, set the moving object's position exactly flush against the surface it hit (rather than leaving it embedded or floating).
After detecting a collision, set the moving object's position exactly flush against the surface it hit (rather than leaving it embedded or floating).