# ScheduleBatch

> Schedules a batch of capsule casts to perform in a job.

## Definition

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

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

Schedules a batch of capsule casts to perform in a job.

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

### Parameters

**** (\[NativeArray\<CapsulecastCommand>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): A NaviveArray of CapsulecastCommands to perform.**** (\[NativeArray\<RaycastHit>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): A NavtiveArray 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 CapsuleCast can hit.**** (\[JobHandle]\(/engine/6000.6/script-reference/unity/jobs/jobhandle)): A jobHandle of a job that must be completed before performing capsule casts.

### Returns

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

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

Schedules a batch of capsule casts to perform in a job.

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

### Parameters

**** (\[NativeArray\<CapsulecastCommand>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): A NaviveArray of CapsulecastCommands to perform.**** (\[NativeArray\<RaycastHit>]\(/engine/6000.6/script-reference/unity/collections/nativearray1)): A NavtiveArray 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.6/script-reference/unity/jobs/jobhandle)): A jobHandle of a job that must be completed before performing capsule casts.

### Returns

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

### Remarks

By default maxHits in this variant is set to 1.
