<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshInstancesComponent/init(mesh:modelID:instances:bounds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation22MeshInstancesComponentV4mesh7modelID9instances6boundsAcA0C8ResourceC_SSSgAA20LowLevelInstanceDataCAA11BoundingBoxVSgtKcfc"
  },
  "title" : "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.

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)