Skip to main content

BoxCollider.ClosestPoint(Vector3 position)

Returns a point on the collider that is closest to a given location.

Parameters:

NameTypeDescription
positionVector3Location you want to find the closest point to.

Returns:

typeDescription
Vector3The point on the collider that is closest to the specified location.

Usage

---@type BoxCollider
local boxcollider;

---@type Vector3
local position;


local val0 = boxcollider.ClosestPoint(position)