<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/PhysicsSimulationComponent/nearestSimulationEntity(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation26PhysicsSimulationComponentV07nearestD6Entity3forAA0G0CSgAG_tFZ"
  },
  "title" : "nearestSimulationEntity(for:)"
}
-->

# nearestSimulationEntity(for:)

Obtains the entity containing the physics simulation origin.

```
static func nearestSimulationEntity(for entity: Entity) -> Entity?
```

## Parameters

`entity`

The entity to find the physics simulation origin for.

## Return Value

The entity containing the physics simulation origin or `nil` if the entity doesn’t have a parent object in the scene.

## Discussion

The simulation origin is the nearest parent object where a [`PhysicsSimulationComponent`](/documentation/RealityKit/PhysicsSimulationComponent)
exists, or the root entity (normally the anchor) where the default simulation is embedded.

---

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)