---
title: "move(to:relativeTo:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/hastransform/move(to:relativeto:)-6lohd"
---

# move(to:relativeTo:)

Moves an entity instantly to a new location given by a transform.

## Declaration

```swift
@MainActor @preconcurrency func move(to transform: Transform, relativeTo referenceEntity: Entity?)
```

## Parameters

- `transform`: A doc://com.apple.RealityKit/documentation/RealityKit/Transform instance that indicates the new location.
- `referenceEntity`: The entity that defines a frame of reference. Set this to nil to indicate world space.

## See Also

### Moving an entity

- [move(to:relativeTo:)](realitykit/hastransform/move(to:relativeto:)-6jul8.md)
- [look(at:from:upVector:relativeTo:)](realitykit/hastransform/look(at:from:upvector:relativeto:).md)
- [look(at:from:upVector:relativeTo:forward:)](realitykit/hastransform/look(at:from:upvector:relativeto:forward:).md)
- [align(_:to:)](realitykit/hastransform/align(_:to:).md)
