Skip to main content

Physics.ClosestPoint(Vector3 point, Vector3 collider, Vector3 position, Vector3 rotation)

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

Parameters:

NameTypeDescription
pointVector3Location you want to find the closest point to.
colliderVector3The collider that you find the closest point on.
positionVector3The position of the collider.
rotationVector3The rotation of the collider.

Returns:

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

Usage

---@type Vector3
local point;

---@type Vector3
local collider;

---@type Vector3
local position;

---@type Vector3
local rotation;


local val0 = Physics:ClosestPoint(point, collider, position, rotation)