Skip to content

Api > Collider > ClosestPoint()


Collider.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 Collider
local collider;

---@type Vector3
local position;


local val0 = collider.ClosestPoint(position)