<!--
{
  "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/move(to:relativeTo:duration:timingFunction:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation12HasTransformPAAE4move2to10relativeTo8duration14timingFunctionAA27AnimationPlaybackControllerCAA0D0V_AA6EntityCSgSdAA0l6TimingK0VtF::OverloadGroup"
  },
  "title" : "move(to:relativeTo:duration:timingFunction:)"
}
-->

# move(to:relativeTo:duration:timingFunction:)

Moves an entity over a period of time to a new location given by a
transform.

```
@discardableResult @MainActor @preconcurrency func move(to target: Transform, relativeTo referenceEntity: Entity?, duration: TimeInterval, timingFunction: AnimationTimingFunction = .default) -> AnimationPlaybackController
```

## Parameters

`target`

A [`Transform`](/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.

`duration`

The time in seconds over which the move should occur.

`timingFunction`

A timing function that controls the progress of the
animation.

## Return Value

An [`AnimationPlaybackController`](/documentation/RealityKit/AnimationPlaybackController) instance that you use to
control the animation playback.

## Discussion

Animating the scale of an entity to 0 will cause a subsequent inverse
of the entity’s transform to return NaN values.  Developers may consider animating
the scale of an entity to a small non-zero value. When the move completes, the
entity can then be hidden or removed if applicable to the use case.

---

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)