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

# position(relativeTo:)

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

## Declaration

```swift
@MainActor @preconcurrency func position(relativeTo referenceEntity: Entity?) -> SIMD3<Float>
```

## Parameters

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

## Return Value

Return Value The position of the entity relative to referenceEntity.

## See Also

### Positioning an entity

- [position](realitykit/hastransform/position.md)
- [setPosition(_:relativeTo:)](realitykit/hastransform/setposition(_:relativeto:).md)
