Skip to content

Api > BoxCollider > ClosestPoint()


BoxCollider.ClosestPoint(Vector3 position)⚓︎

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

Parameters:⚓︎

Name Type Description
position Vector3 Location you want to find the closest point to.

Returns:⚓︎

type Description
Vector3 The 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)