Method GetClosestPoint
GetClosestPoint(Vector3)
Tries to get the closest point on the associated snapping collider. If snapToCollider is null, it will return the transform position of the associated interactable. If both snapToCollider and interactable are null, it will return the transform position of this GameObject.
Declaration
public Vector3 GetClosestPoint(Vector3 point)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | point | The point for which we are trying to find the the nearest point on the snapToCollider. |
Returns
| Type | Description |
|---|---|
| Vector3 | The closest point on the snapToCollider if possible. Defaults to the interactable transform position if available, or the transform position of this GameObject. |