---
title: "init(mesh:meshDraping:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/clothbodycomponent/init(mesh:meshdraping:)"
---

# init(mesh:meshDraping:)

Creates a new cloth body component.

## Declaration

```swift
init(mesh: ClothMeshResource, meshDraping: ClothPoseResource? = nil)
```

## Parameters

- `mesh`: The (simulation) mesh of the cloth body, which defines its at-rest shape.
- `meshDraping`: An optional initial pose for the body.

## Discussion

Discussion The body component must be attached to an entity that is a descendant of a simulation root (an entity with a ClothSimulationComponent) in order to be active.

## See Also

### Creating a cloth body

- [mesh](realitykit/clothbodycomponent/mesh.md)
- [initialMeshDraping](realitykit/clothbodycomponent/initialmeshdraping.md)
