---
title: "force::drag"
framework: Compute Graph
role: symbol
role_heading: Function
platforms: [iOS 27.0+, iPadOS 27.0+, macOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: computegraph/force/drag
---

# force::drag

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

## Declaration

```swift
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

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) note:  note: Reads and writes to element state float3 velocity
