---
title: "init(mesh:modelID:instances:bounds:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/meshinstancescomponent/init(mesh:modelid:instances:bounds:)"
---

# init(mesh:modelID:instances:bounds:)

Creates a mesh instances component with a mesh resource, optional model ID, instance data, and optional bounding box.

## Declaration

```swift
init(mesh: MeshResource, modelID: String? = nil, instances: LowLevelInstanceData, bounds: BoundingBox? = nil) throws
```

## Parameters

- `mesh`: The mesh resource to instance.
- `modelID`: The name of the model to use. Set to nil if there is only one model in the mesh resource.
- `instances`: The instance data containing the number of instances, and the transforms for each instance.
- `bounds`: The bounding box to use for the instance group this part draws.
