# ClosestPointCommand

> Obsolete. Use the constructor with EntityId instead.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.PhysicsModule

## ClosestPointCommand(Vector3, int, Vector3, Quaternion, Vector3)

Obsolete. Use the constructor with EntityId instead.

> **Warning:**
>
> **Removed.** ClosestPointCommand(Vector3, int, Vector3, Quaternion, Vector3) is obsolete. Use ClosestPointCommand(Vector3, EntityId, Vector3, Quaternion, Vector3) instead.

```csharp
public ClosestPointCommand(Vector3 point, int colliderInstanceID, Vector3 position, Quaternion rotation, Vector3 scale)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Location you want to find the closest point to.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the Collider that you find the closest point on.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The position of the Collider.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): The rotation of the Collider.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The global scale of the Collider.

### Remarks

Create a ClosestPointCommand using Instance ID of the Collider.

## ClosestPointCommand(Vector3, Collider, Vector3, Quaternion, Vector3)

Create a ClosestPointCommand using a Collider reference.

```csharp
public ClosestPointCommand(Vector3 point, Collider collider, Vector3 position, Quaternion rotation, Vector3 scale)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Location you want to find the closest point to.**** (\[Collider]\(/engine/6000.7/script-reference/unityengine/collider)): The Collider that you find the closest point on.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The position of the Collider.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): The rotation of the Collider.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The global scale of the Collider.

### Remarks

Can only be invoked from the main thread, since Unity Components are unavailable off the main thread. In the threaded context, use the other constructor that accepts EntityId instead.

## ClosestPointCommand(Vector3, EntityId, Vector3, Quaternion, Vector3)

Create a ClosestPointCommand using EntityId of the Collider.

```csharp
public ClosestPointCommand(Vector3 point, EntityId colliderEntityId, Vector3 position, Quaternion rotation, Vector3 scale)
```

### Parameters

**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): Location you want to find the closest point to.**** (\[EntityId]\(/engine/6000.7/script-reference/unityengine/entityid)): The EntityId of the Collider that you find the closest point on.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The position of the Collider.**** (\[Quaternion]\(/engine/6000.7/script-reference/unityengine/quaternion)): The rotation of the Collider.**** (\[Vector3]\(/engine/6000.7/script-reference/unityengine/vector3)): The global scale of the Collider.
