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

# ClothColliderComponent

A component that adds a cloth-compatible collider to an entity.

```
struct ClothColliderComponent
```

## Overview

A cloth collider belongs to the simulation root defined by its closest ancestor entity with a [`ClothSimulationComponent`](/documentation/RealityKit/ClothSimulationComponent), if any.

By default, a collider ensures that cloth bodies ([`ClothBodyComponent`](/documentation/RealityKit/ClothBodyComponent)) stay outside of its shape.
Colliders can also report when such collisions occur.
Colliders themselves are not simulated and are (unlike bodies) not affected by bodies or by other colliders.

As an example, you can simulate and render a cloth body together with a collider by setting up your entity hierarchy as follows.

```
- scene
  - rootEntity (ClothSimulationComponent)
    - dressEntity (ClothBodyComponent + ModelComponent)
    - characterEntity (ClothColliderComponent + ModelComponent)
```

The shape of a collider can either be a mesh or an implicit shape.
All implicit shapes are mutable at runtime.
The mesh shape is directly mutable at runtime only if it is a [`LowLevelMesh`](/documentation/RealityKit/LowLevelMesh).
When suitable, it is recommended to use colliders with implicit shapes for improved performance.

If the shape of a collider is a mesh and the same entity has a [`ModelComponent`](/documentation/RealityKit/ModelComponent), then the two meshes will attempt to stay in sync.
In this context, the mesh of the collider and the [`ModelComponent`](/documentation/RealityKit/ModelComponent) would be known as the simulation mesh and visual mesh, respectively.
In particular:

- if both meshes are [`LowLevelMesh`](/documentation/RealityKit/LowLevelMesh), then they will not stay in sync at all.
- if only the simulation mesh is a [`LowLevelMesh`](/documentation/RealityKit/LowLevelMesh), then the visual mesh will follow the simulation mesh.
- otherwise, the simulation mesh will follow the visual mesh (regardless if it is a [`LowLevelMesh`](/documentation/RealityKit/LowLevelMesh)).

## Topics

### Creating a cloth collider

[`init(shape: ClothColliderShape)`](/documentation/RealityKit/ClothColliderComponent/init(shape:))

Creates a cloth collider component with the given shape.

[`init(mesh: ClothMeshResource, bias: Float)`](/documentation/RealityKit/ClothColliderComponent/init(mesh:bias:))

Creates a cloth collider component with a mesh shape built from the given mesh resource.

[`init(meshShape: ClothMeshShape)`](/documentation/RealityKit/ClothColliderComponent/init(meshShape:))

Creates a cloth collider component with the given mesh shape.

### Configuring the collider shape

[`var shape: ClothColliderShape`](/documentation/RealityKit/ClothColliderComponent/shape)

The (simulation) shape of the collider.

[`var materialNames: [String]`](/documentation/RealityKit/ClothColliderComponent/materialNames)

The names of the collider materials used by this collider.

### Managing collision response

[`var isCollisionResponseEnabled: Bool`](/documentation/RealityKit/ClothColliderComponent/isCollisionResponseEnabled)

Indicates whether this collider pushes away intersecting cloth body particles.

[`func enableCollisions(towards: ClothCollisionGroupSet)`](/documentation/RealityKit/ClothColliderComponent/enableCollisions(towards:))

Enables one-way collisions towards the selected groups.

[`func disableCollisions(towards: ClothCollisionGroupSet)`](/documentation/RealityKit/ClothColliderComponent/disableCollisions(towards:))

Disables one-way collisions towards the selected groups.

### Instance Properties

[`var collisionFilter: ClothCollisionFilter`](/documentation/RealityKit/ClothColliderComponent/collisionFilter)

Defines the collision groups that the collider belongs to, and the mask used to determine which groups this collider affects.

## 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)