Garry's Mod Wiki


  Vector Entity:NearestPoint( Vector position )


Performs a Ray-Orientated Bounding Box intersection from the given position to the origin of the OBBox with the entity and returns the hit position on the OBBox.

This relies on the entity having a collision mesh (not a physics object) and will be affected by SOLID_NONE


1 Vector position
The vector to start the intersection from.


1 Vector
The nearest hit point of the entity's bounding box in world coordinates.