---
title: "setMeshInstances(_:at:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/lowlevelrenderer/setmeshinstances(_:at:)"
---

# setMeshInstances(_:at:)

Assigns a mesh instance array to the given slot index.

## Declaration

```swift
final func setMeshInstances(_ meshInstances: LowLevelMeshInstanceArray?, at index: Int) throws(LowLevelRendererError)
```

## Parameters

- `meshInstances`: The mesh instance array to assign, or nil to clear the slot.
- `index`: The zero-based slot index to assign to. Must be within 0..<meshInstancesArrayCount.

## Discussion

Discussion note: LowLevelRendererError if the renderer’s render target descriptor is not contained in the array’s descriptor set.

## See Also

### Managing mesh instances

- [meshInstances(at:)](realitykit/lowlevelrenderer/meshinstances(at:).md)
- [meshInstancesArrayCount](realitykit/lowlevelrenderer/meshinstancesarraycount.md)
