# BoxcastCommand

> Creates a BoxcastCommand.

## Definition

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

## BoxcastCommand(Vector3, Vector3, Quaternion, Vector3, QueryParameters, float)

Creates a BoxcastCommand.

```csharp
public BoxcastCommand(Vector3 center, Vector3 halfExtents, Quaternion orientation, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The center of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The half size of the box in each dimension.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The direction in which to sweep the box.**** (\[QueryParameters]\(/engine/6000.0/script-reference/unityengine/queryparameters)): Structure for specifying additional parameters for a batch query such as layer mask, hit triggers and hit backfaces.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum length of the cast.

### Remarks

This command is run in the default physics scene.

## BoxcastCommand(PhysicsScene, Vector3, Vector3, Quaternion, Vector3, QueryParameters, float)

Creates a BoxcastCommand.

```csharp
public BoxcastCommand(PhysicsScene physicsScene, Vector3 center, Vector3 halfExtents, Quaternion orientation, Vector3 direction, QueryParameters queryParameters, float distance = 3.4028235E+38)
```

### Parameters

**** (\[PhysicsScene]\(/engine/6000.0/script-reference/unityengine/physicsscene)): The physics scene to run the command in.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The center of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The half size of the box in each dimension.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The direction in which to sweep the box.**** (\[QueryParameters]\(/engine/6000.0/script-reference/unityengine/queryparameters)): Structure for specifying additional parameters for a batch query such as layer mask, hit triggers and hit backfaces.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum length of the cast.

## BoxcastCommand(Vector3, Vector3, Quaternion, Vector3, float, int)

Creates a BoxcastCommand.

> **Warning:**
>
> **Deprecated.** This struct signature is no longer supported. Use struct with a QueryParameters instead

```csharp
public BoxcastCommand(Vector3 center, Vector3 halfExtents, Quaternion orientation, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5)
```

### Parameters

**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The center of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The half size of the box in each dimension.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The direction in which to sweep the box.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum length of the cast.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A LayerMask that is used to selectively ignore Colliders when casting a box.

### Remarks

This command is run in the default physics scene.

## BoxcastCommand(PhysicsScene, Vector3, Vector3, Quaternion, Vector3, float, int)

Creates a BoxcastCommand.

> **Warning:**
>
> **Deprecated.** This struct signature is no longer supported. Use struct with a QueryParameters instead

```csharp
public BoxcastCommand(PhysicsScene physicsScene, Vector3 center, Vector3 halfExtents, Quaternion orientation, Vector3 direction, float distance = 3.4028235E+38, int layerMask = -5)
```

### Parameters

**** (\[PhysicsScene]\(/engine/6000.0/script-reference/unityengine/physicsscene)): The physics scene to run the command in.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The center of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The half size of the box in each dimension.**** (\[Quaternion]\(/engine/6000.0/script-reference/unityengine/quaternion)): The rotation of the box.**** (\[Vector3]\(/engine/6000.0/script-reference/unityengine/vector3)): The direction in which to sweep the box.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The maximum length of the cast.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): A LayerMask that is used to selectively ignore Colliders when casting a box.
