<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothSimulationComponent/MaterialCollection/subscript(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C19SimulationComponentV18MaterialCollectionVyAA0c4BodyF0VSgSS_AGmtcip::OverloadGroup"
  },
  "title" : "subscript(_:_:)"
}
-->

# subscript(_:_:)

Accesses a body material by name, returning `nil` if the name is absent or the material is not a body material.

```
subscript(name: String, type: ClothBodyMaterial.Type) -> ClothBodyMaterial? { get set }
```

---

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)