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:
Name | Type | Description |
---|---|---|
point | Vector3 | Location you want to find the closest point to. |
collider | Vector3 | The collider that you find the closest point on. |
position | Vector3 | The position of the collider. |
rotation | Vector3 | The rotation of the collider. |
Returns:
type | Description |
---|---|
Vector3 | The 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)