<!--
{
  "availability" : [
    "Reality Composer Pro: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ComputeGraph",
  "identifier" : "/documentation/ComputeGraph/force/drag",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Compute Graph"
    ],
    "preciseIdentifier" : "force::drag"
  },
  "title" : "force::drag"
}
-->

# force::drag

Applies linear drag to slow down the current element over time.

```
void force::drag(float linearDragFactor)
```

## Parameters

`linearDragFactor`

The drag coefficient controlling how quickly the element slows down.
Higher values result in faster deceleration. A value of 0 means no drag.

## Discussion

This function simulates air resistance or fluid drag by reducing the element’s
velocity proportionally to its current speed. The drag is frame-rate independent,
ensuring consistent behavior across different frame rates.

The drag force is calculated as: `velocity -= velocity * min(1.0, deltaTime * linearDragFactor)`

> Visual: ![Graph](force__drag)

> Note: Reads and writes to element state `float3 velocity`

---

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)