---
title: "init(effect:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/forceeffectcomponent/init(effect:)"
---

# init(effect:)

Creates a force effect component with a single force effect, and automatically plays it.

## Declaration

```swift
init(effect: any ForceEffectBase)
```

## Parameters

- `effect`: The effect to simulate forces with.
