---
title: "force::gravity"
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/gravity
---

# force::gravity

Applies a gravity force to the current element

## Declaration

```swift
void force::gravity(float gravity)
```

## Parameters

- `gravity`: Value indicating amount of gravity. By convention, positive gravity is in the downward direction. Negative values of gravity will apply an upward force.

## Discussion

Discussion note:
