What does GetClosestPointOnSurface do?

I haven’t seen it mentioned here and the description there is empty.
BasePart | Documentation - Roblox Creator Hub

I would assume it’s going to return the closest point on the bounding box of that BasePart. Currently it does nothing.
image

Aw. It would be very nifty to be able to use it instead doing a raycast

99.99% of the time the closest point on the box is going to be one of the corners. Naïve solution is to just magnitude check all 8.

Raycasting from your point to the part with nothing else in the include list is a lot easier and works for shapes other than boxes.

1 Like