<!--
{
  "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/setOrientation(_:relativeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12HasTransformPAAE14setOrientation_10relativeToySo10simd_quatfa_AA6EntityCSgtF"
  },
  "title" : "setOrientation(_:relativeTo:)"
}
-->

# setOrientation(_:relativeTo:)

Sets the orientation of the entity relative to the given reference
entity.

```
@MainActor @preconcurrency func setOrientation(_ orientation: simd_quatf, relativeTo referenceEntity: Entity?)
```

## Parameters

`orientation`

A new orientation, relative to `referenceEntity`.

`referenceEntity`

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

---

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)