<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/HasTransform/orientation(relativeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12HasTransformPAAE11orientation10relativeToSo10simd_quatfaAA6EntityCSg_tF"
  },
  "title" : "orientation(relativeTo:)"
}
-->

# orientation(relativeTo:)

Gets the orientation of an entity relative to the given entity.

```
@MainActor @preconcurrency func orientation(relativeTo referenceEntity: Entity?) -> simd_quatf
```

## Parameters

`referenceEntity`

The entity that defines a frame of reference. Set
this to `nil` to indicate world space.

## Return Value

The orientation of the entity relative to `referenceEntity`.

---

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)