# sortingPosition

> Together with BatchDrawCommand.flags, this specifies how to depth sort the instances in this draw command.

## Definition

* **Type:** Field
* **Namespace:** [UnityEngine.Rendering](/engine/6000.6/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public int sortingPosition
```

### Remarks

If [BatchDrawCommandFlags.HasSortingPosition](/engine/6000.6/script-reference/unityengine/rendering/batchdrawcommandflags/hassortingposition.md) is set, this contains the index of the first position in the [BatchCullingOutputDrawCommands.instanceSortingPositions](/engine/6000.6/script-reference/unityengine/rendering/batchcullingoutputdrawcommands/instancesortingpositions.md) array which contains world-space positions that Unity uses to depth sort the instances. In this case, set this value to the index of the x component of the world space position of the first instance.

If [BatchDrawCommandFlags.HasSortingPosition](/engine/6000.6/script-reference/unityengine/rendering/batchdrawcommandflags/hassortingposition.md) is not set, Unity casts this value to a float and uses it as an approximate depth to depth sort the instances in the draw command.
