# ScheduleBatch

> Schedules a batch of boxcasts to be performed in a job.

## Definition

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

## ScheduleBatch(NativeArray\<BoxcastCommand>, NativeArray\<RaycastHit>, int, int, JobHandle)

Schedules a batch of boxcasts to be performed in a job.

```csharp
public static JobHandle ScheduleBatch(NativeArray<BoxcastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, int maxHits, JobHandle dependsOn = default)
```

### Parameters

**** (\[NativeArray\<BoxcastCommand>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): A NativeArray of the BoxcastCommand to perform.**** (\[NativeArray\<RaycastHit>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): A NativeArray of RaycastHit where the result of commands are stored.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The minimum number of commands to perform in a single job.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The maximum number of Colliders the BoxCast can hit.**** (\[JobHandle]\(/engine/6000.0/script-reference/unity/jobs/jobhandle)): A JobHandle of a job that must be completed before performing the box casts.

### Returns

| Type                                                                 | Description                                                     |
| -------------------------------------------------------------------- | --------------------------------------------------------------- |
| [JobHandle](/engine/6000.0/script-reference/unity/jobs/jobhandle.md) | Returns a JobHandle of the job that will perform the box casts. |

## ScheduleBatch(NativeArray\<BoxcastCommand>, NativeArray\<RaycastHit>, int, JobHandle)

Schedules a batch of boxcasts to be performed in a job.

```csharp
public static JobHandle ScheduleBatch(NativeArray<BoxcastCommand> commands, NativeArray<RaycastHit> results, int minCommandsPerJob, JobHandle dependsOn = default)
```

### Parameters

**** (\[NativeArray\<BoxcastCommand>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): A NativeArray of the BoxcastCommand to perform.**** (\[NativeArray\<RaycastHit>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): A NativeArray of RaycastHit where the result of commands are stored.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The minimum number of commands to perform in a single job.**** (\[JobHandle]\(/engine/6000.0/script-reference/unity/jobs/jobhandle)): A JobHandle of a job that must be completed before performing the box casts.

### Returns

| Type                                                                 | Description                                                     |
| -------------------------------------------------------------------- | --------------------------------------------------------------- |
| [JobHandle](/engine/6000.0/script-reference/unity/jobs/jobhandle.md) | Returns a JobHandle of the job that will perform the box casts. |

### Remarks

By default maxHits in this variant is set to 1.
