---
title: "orientation(relativeTo:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/hastransform/orientation(relativeto:)"
---

# orientation(relativeTo:)

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

## Declaration

```swift
@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

Return Value The orientation of the entity relative to referenceEntity.

## See Also

### Rotating an entity

- [orientation](realitykit/hastransform/orientation.md)
- [setOrientation(_:relativeTo:)](realitykit/hastransform/setorientation(_:relativeto:).md)
