<!--
{
  "availability" : [
    "visionOS: 26.0.0 -",
    "Xcode: 26.0.0 -"
  ],
  "documentType" : "article",
  "framework" : "visionOS",
  "identifier" : "/documentation/visionOS/tracking-points-in-world-space",
  "metadataVersion" : "0.1.0",
  "role" : "sampleCode",
  "title" : "Tracking specific points in world space"
}
-->

# Tracking specific points in world space

Retrieve the position and orientation of anchors your app stores in ARKit.

## Overview

Use world anchors along with an ARKit session’s <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider> to track points of interest in the world over time, as a person moves while wearing the device, and across device usage sessions. For example, someone might place a 3D object in a specific position on their desk and expect it to come back the next time they use the device.

![A video that rotates around a 3D teapot anchored to a table in the real world. A debug visualization shows the X-, Y-, and Z-axes of the world anchor that determines the position of the teapot.](videos/com.apple.visionOS/world-tracking.mp4)

ARKit keeps track of a unique identifier for each world anchor your app creates and automatically places those anchors back in the space when the person returns to your app in the same location. A world tracking provider also provides the position of the device the person is wearing.

### Start an ARKit session with world tracking

Use an <doc://com.apple.documentation/documentation/ARKit/ARKitSession> configured for world tracking to start receiving updates on the world anchors your app places. The following shows updates to world anchors your app previously registered using the <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider/addAnchor(_:)> method:

```swift
let session = ARKitSession()
let worldInfo = WorldTrackingProvider()

Task {
    try await session.run([worldInfo])
    
    for await update in worldInfo.anchorUpdates {
        switch update.event {
        case .added, .updated:
            // Update the app's understanding of this world anchor.
            print("Anchor position updated.")
        case .removed:
            // Remove content related to this anchor.
            print("Anchor position now unknown.")
    }
}
```

> Important: If a person repositions the current space — for example, by holding down the Digital Crown — world anchor updates begin updating their position relative to the new world origin. For example, a world anchor placed on a table still reports information about the table’s position, but those positions are relative to the updated world origin.

### Create and add world anchors

You can create world anchors for any point of interest in your app’s world coordinate system once you’ve started a world tracking ARKit session. For example, you might track that a person placed an item at a particular offset from a desk in their space:

```swift
let anchor = WorldAnchor(originFromAnchorTransform: deskPlane.originFromAnchorTransform + offset)
try await worldInfo.addAnchor(anchor)
```

Once you add a world anchor to your app’s tracking provider using the <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider/addAnchor(_:)> method, the <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider/anchorUpdates> sequence in the current session and future runs of your app provides updates to the current position of that new world anchor.

### Persist world anchors across sessions

The only information ARKit persists about the world anchors in your app is their <doc://com.apple.documentation/documentation/Foundation/UUID> — a <doc://com.apple.documentation/documentation/ARKit/WorldAnchor> instance’s <doc://com.apple.documentation/documentation/ARKit/WorldAnchor/id> property — and pose in a particular space. It’s your app’s responsibility to persist additional information, such as the meaning of each anchor. For example, you might save local data about a custom 3D lamp model that a person placed on their desk.

As a person moves from town-to-town or room-to-room, your app won’t receive all of the world anchor updates from each place someone used your app. Instead, the <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider/anchorUpdates> sequence only provides world anchors for nearby objects.

### Track the device position in the world

Use the Compositor Services framework and the <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider> class’s <doc://com.apple.documentation/documentation/ARKit/WorldTrackingProvider/queryDeviceAnchor(atTimestamp:)> method to get low-latency information about the current and future-predicted pose of the person’s device in world space. For more information, see <doc://com.apple.documentation/documentation/CompositorServices/drawing-fully-immersive-content-using-metal>.

---

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)