<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ClothSimulationComponent",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:22RealityFoundationCloth0C19SimulationComponentV"
  },
  "title" : "ClothSimulationComponent"
}
-->

# ClothSimulationComponent

A component that marks an entity as the simulation root of a localized cloth simulation.

```
struct ClothSimulationComponent
```

## Overview

Each entity in a scene belongs to at most one cloth simulation, which is the ancestor closest in the entity hierarchy with a [`ClothSimulationComponent`](/documentation/RealityKit/ClothSimulationComponent).
Separate simulations do not interact with each other, which can improve power and performance.
As an example, if you want two cloth simulations, then you can set up your entity hierarchy as follows.

```
- scene
  - entity1 (ClothSimulationComponent)
    - entity2 (ClothBodyComponent)
  - entity3 (ClothSimulationComponent)
    - entity4 (ClothBodyComponent)
    - entity5
      - entity6 (ClothColliderComponent)
```

In the above example, `entity1` is the root of a cloth simulation and `entity2` is part of that simulation.
Similarly, `entity3` is the root of a different cloth simulation that `entity4`, `entity5`, and `entity6` are all part of.

The simulation component itself mainly configures the quality, performance, and pace of the simulation.
The solver and time step together balance the quality vs. performance of the simulation.
You can guide the pace of the simulation by controlling its target clock ([`targetClock`](/documentation/RealityKit/ClothSimulationComponent/targetClock)).
Meanwhile, you can also follow the pace of the simulation by syncing with its simulation clock ([`simulationClock`](/documentation/RealityKit/ClothSimulationComponent/simulationClock)).

On thermally constrained devices, sustained cloth simulation work can contribute to system heat,
and the device may begin throttling once the thermal state escalates beyond `.nominal`.
To stay responsive to the device’s available thermal headroom, read `ProcessInfo.processInfo.thermalState`
and observe `ProcessInfo.thermalStateDidChangeNotification` to react when it changes.
As the reported state moves from `.fair` toward `.serious` and `.critical`, dial back simulation cost.
For example, you can lower [`maximumStepsPerUpdate`](/documentation/RealityKit/ClothSimulationComponent/maximumStepsPerUpdate-swift.property),
increase [`meshCollidersUpdateInterval`](/documentation/RealityKit/ClothSimulationComponent/meshCollidersUpdateInterval),
prefer implicit collider shapes (sphere, box, capsule, etc.) over mesh colliders where possible,
or choose a cheaper solver configuration via [`ClothSimulationComponent.Solver`](/documentation/RealityKit/ClothSimulationComponent/Solver-swift.struct).
Reducing the number of active simulations and the particle count of bodies within them is also effective,
since power and performance costs scale with both.

The simulation component also stores various parameters that affect the entire simulation, like gravity.
Notably, it stores the collection of runtime-modifiable materials that are available to its bodies ([`ClothBodyComponent`](/documentation/RealityKit/ClothBodyComponent)) and colliders ([`ClothColliderComponent`](/documentation/RealityKit/ClothColliderComponent)).
The exact interactions between these materials can be further configured through the simulation’s friction overrides.

## Topics

### Creating a cloth simulation

[`init(solver:)`](/documentation/RealityKit/ClothSimulationComponent/init(solver:))

Creates a new simulation component for cloth bodies.

### Configuring the solver

[`solver`](/documentation/RealityKit/ClothSimulationComponent/solver-swift.property)

The solver used by this simulation, configured at initialization and immutable thereafter.

[`Solver`](/documentation/RealityKit/ClothSimulationComponent/Solver-swift.struct)

The permanent solver configuration of a cloth simulation.

### Applying forces

[`gravity`](/documentation/RealityKit/ClothSimulationComponent/gravity)

The gravitational acceleration for the bodies in the simulation, in m/s².

[`wind`](/documentation/RealityKit/ClothSimulationComponent/wind)

The wind force affecting all the cloth bodies in the simulation, in Newtons.

[`dampingFactor`](/documentation/RealityKit/ClothSimulationComponent/dampingFactor)

The damping factor affecting all the cloth bodies in the simulation.
The expected range is between 0 and 1 (included).

### Assigning materials

[`materials`](/documentation/RealityKit/ClothSimulationComponent/materials)

A collection of materials that cloth colliders and cloth bodies can use in this simulation.

[`MaterialCollection`](/documentation/RealityKit/ClothSimulationComponent/MaterialCollection)

A collection of materials.

[`Material`](/documentation/RealityKit/ClothSimulationComponent/Material)

A material that represents a cloth body or collider material.

### Overriding friction

[`frictionOverrides`](/documentation/RealityKit/ClothSimulationComponent/frictionOverrides)

A map to manually override friction values between pairs of materials.

[`FrictionOverridesCollection`](/documentation/RealityKit/ClothSimulationComponent/FrictionOverridesCollection)

A collection of materials pairs whose combined frictions are overridden.

### Controlling simulation timing

[`timeStep`](/documentation/RealityKit/ClothSimulationComponent/timeStep)

The amount of time the simulation advances each time step, in seconds.

[`maximumStepsPerUpdate`](/documentation/RealityKit/ClothSimulationComponent/maximumStepsPerUpdate-swift.property)

The maximum number of time steps that the simulation can advance each update.

[`MaximumStepsPerUpdate`](/documentation/RealityKit/ClothSimulationComponent/MaximumStepsPerUpdate-swift.struct)

The maximum number of time steps that can be processed per simulation update.

[`speedLimit`](/documentation/RealityKit/ClothSimulationComponent/speedLimit-swift.property)

The speed limit configuration of the simulation.

[`SpeedLimit`](/documentation/RealityKit/ClothSimulationComponent/SpeedLimit-swift.struct)

Whether the speed of cloth bodies should be limited to improve self-collision robustness.

[`meshCollidersUpdateInterval`](/documentation/RealityKit/ClothSimulationComponent/meshCollidersUpdateInterval)

The number of time steps between updates to the mesh colliders in the simulation.

### Synchronizing the clock

[`targetClock`](/documentation/RealityKit/ClothSimulationComponent/targetClock)

The clock that this simulation attempts to follow.

[`simulationClock`](/documentation/RealityKit/ClothSimulationComponent/simulationClock)

The clock that tracks the pace of this simulation.

## Relationships

### Conforms To

[`Component`](/documentation/RealityKit/Component)

---

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)