<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNPhysicsField/linearGravity()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNPhysicsField(cm)linearGravityField"
  },
  "title" : "linearGravity()"
}
-->

# linearGravity()

Creates a field that accelerates objects in a specific direction.

```
class func linearGravity() -> SCNPhysicsField
```

## Return Value

A physics field object. To use the field in a scene, attach it to the [`physicsField`](/documentation/SceneKit/SCNNode/physicsField) property of an [`SCNNode`](/documentation/SceneKit/SCNNode) object.

## Discussion

Because the force of gravity on an object is proportional to the object’s mass, this force accelerates all objects in the field’s area of affect by the same amount. The field’s [`strength`](/documentation/SceneKit/SCNPhysicsField/strength) property measures this acceleration in meters per second per second.

By default, a linear gravity field accelerates objects in along its [`direction`](/documentation/SceneKit/SCNPhysicsField/direction) vector. To make it accelerate objects in the opposite direction, set the field’s [`strength`](/documentation/SceneKit/SCNPhysicsField/strength) property to a negative value.

The default [`falloffExponent`](/documentation/SceneKit/SCNPhysicsField/falloffExponent) value for a linear gravity field is `0.0`, indicating that the field’s effect is constant throughout its area of effect.

---

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)