---
title: "removeMaterial(at:)"
framework: scenekit
role: symbol
role_heading: Instance Method
path: "scenekit/scngeometry/removematerial(at:)"
---

# removeMaterial(at:)

Removes a material attached to the geometry.

## Declaration

```swift
func removeMaterial(at index: Int)
```

## Parameters

- `index`: The index of the attached material to be removed. important: Raises an exception (doc://com.apple.documentation/documentation/Foundation/NSExceptionName/rangeException) if index is beyond the bounds of the doc://com.apple.scenekit/documentation/SceneKit/SCNGeometry/materials array.

## See Also

### Managing a Geometry’s Materials

- [materials](scenekit/scngeometry/materials.md)
- [firstMaterial](scenekit/scngeometry/firstmaterial.md)
- [material(named:)](scenekit/scngeometry/material(named:).md)
- [insertMaterial(_:at:)](scenekit/scngeometry/insertmaterial(_:at:).md)
- [replaceMaterial(at:with:)](scenekit/scngeometry/replacematerial(at:with:).md)
