---
title: "init(mesh:materials:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/modelcomponent/init(mesh:materials:)"
---

# init(mesh:materials:)

Creates a model component from a mesh and a collection of materials.

## Declaration

```swift
init(mesh: MeshResource, materials: [any Material])
```

## Parameters

- `mesh`: The mesh that describes the shape of the model.
- `materials`: Materials used to give the mesh a certain visual appearance.
