<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MeshBuffer/init(elements:indices:)-4kg29",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation10MeshBufferVAAs5SIMD3VySfGRszlE8elements7indicesACyAFGSayAFG_Says6UInt32VGtcfc"
  },
  "title" : "init(elements:indices:)"
}
-->

# init(elements:indices:)

Create buffer from an array of element values and an array of indices into that value array.

```
init(elements: [Element], indices: [UInt32])
```

---

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)