<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/SpatialForceFalloff",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19SpatialForceFalloffV"
  },
  "title" : "SpatialForceFalloff"
}
-->

# SpatialForceFalloff

A type that modulates the force strength based on the distance of rigid bodies.

```
struct SpatialForceFalloff
```

## Overview

Forces applied to rigid bodies near the effect’s origin have the largest strength and gradually decay to zero
when approaching the boundary of [`ForceEffectBounds`](/documentation/RealityKit/ForceEffectBounds).

[`rate`](/documentation/RealityKit/SpatialForceFalloff/rate) controls how fast the force strength decays. Under the hood the rate
is an exponent of the normalized distance over the spatial bounds. For example when the rate is 0,
the falloff coefficient (i.e. distance raised to the power of 0) is constantly 1, and that implies no decay or falloff the force strength.

```swift
let noFalloff = SpatialForceFalloff(bounds: .sphere(radius: 10), rate: 0)
```

As another example, you can set [`rate`](/documentation/RealityKit/SpatialForceFalloff/rate) to `1` to decay the force strength linearly.

```swift
let linearFalloff = SpatialForceFalloff(bounds: .sphere(radius: 10), rate: 1)
```

## Topics

### Initializers

[`init(bounds: ForceEffectBounds, rate: Double, distanceOffset: Double)`](/documentation/RealityKit/SpatialForceFalloff/init(bounds:rate:distanceOffset:))

Creates a spatial force falloff.

### Instance Properties

[`var bounds: ForceEffectBounds`](/documentation/RealityKit/SpatialForceFalloff/bounds)

The spatial bounds that define the area over which the force effect’s strength decreases.

[`var distanceOffset: Double`](/documentation/RealityKit/SpatialForceFalloff/distanceOffset)

A distance from the origin where the falloff begins.

[`var rate: Double`](/documentation/RealityKit/SpatialForceFalloff/rate)

The spatial falloff / attenuation rate.

---

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)