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

# ClothGrabComponent

A component that grabs and drags particles of cloth bodies
using either a ray or a volume, as determined by the `mode` property.

```
struct ClothGrabComponent
```

## Overview

When `isGrabbing` is first set to true, a selection is made using the ray/volume. While `isGrabbing` remains
true, the selected particles will be dragged to the position determined by the ray/volume. When `isGrabbing`
is set to false, any selected particles are released and will once again be controlled by the simulation.

To smoothen the motion of particles dragged using a volume, `falloff` can be set to `.enabled`. This
causes the strength of the particle dragging to fall off based on the distance from the volume surface.

## Topics

### Creating a grab component

[`init(mode: ClothGrabComponent.GrabMode)`](/documentation/RealityKit/ClothGrabComponent/init(mode:))

Creates a cloth grab component with the given grab mode.

[`struct GrabMode`](/documentation/RealityKit/ClothGrabComponent/GrabMode)

Defines whether a grab component will select particles using a ray or a volume.

### Configuring the falloff

[`var falloff: ClothGrabComponent.Falloff`](/documentation/RealityKit/ClothGrabComponent/falloff-swift.property)

Controls whether the grabbing strength falls off based on distance from the volume surface.

[`struct Falloff`](/documentation/RealityKit/ClothGrabComponent/Falloff-swift.struct)

Controls whether grab strength falls off based on particle distance from the volume surface.

### Checking the grab state

[`var isGrabbing: Bool`](/documentation/RealityKit/ClothGrabComponent/isGrabbing)

Indicates whether particles are currently being grabbed.

### Instance Properties

[`var mode: ClothGrabComponent.GrabMode`](/documentation/RealityKit/ClothGrabComponent/mode)

Mode that determines whether grabbing will be performed using a ray or a volume.

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