# XRHeadsetTracker

<Badge tone="type">class · sealed · Singleton&lt;XRHeadsetTracker&gt;</Badge> <Badge>Unity component</Badge> <Badge>singleton</Badge>

```csharp
namespace AR51.Unity.SDK.Tracker;

public sealed class XRHeadsetTracker : Singleton<XRHeadsetTracker>
```

**Inherits:** `MonoBehaviour` *(Unity)* → `Singleton<XRHeadsetTracker>`. Access via `XRHeadsetTracker.Instance`.

:::note
Unity SDK units are **meters** (Unity world space). Positions, rotations, and scales below follow that convention.
:::

A Unity component that streams each registered XR device's camera-to-anchor transform and feeds it into [`ObjectTransformConsumer`](/docs/sdk-api/unity-api/classes/objecttransformconsumer) as an [`ObjectTransform`](/docs/sdk-api/unity-api/classes/objecttransform) of type `"XR"` — one per device, keyed by device id. It operates **automatically** through its Unity lifecycle and per-frame `Update`; there is nothing to call. Optionally, it can log each frame's pose to a per-device file.

## Properties

<div className="apiPropTable">

| Property | Type | Default | Description |
|---|---|---|---|
| **Export** | | | |
| `ExportToFile` | `bool` | `false` | when `true`, appends each frame's pose to a per-device text file |
| `FilePath` | `string` | — | ⚠️ **needs confirmation:** expected to be a *directory* path — the filename is generated per device/session, not the file itself |

</div>

## Methods

This component exposes **no public methods** beyond inherited Unity/`Singleton<>` behavior. Its operation is automatic (lifecycle plus per-frame `Update`); you do not call into it. The internal `Tracker` class and all transform-streaming logic are internal and not documented here.

## See also

- [`ObjectTransformConsumer`](/docs/sdk-api/unity-api/classes/objecttransformconsumer) — receives the `"XR"` transforms this tracker emits and spawns/updates GameObjects from them
- [`ObjectTransform`](/docs/sdk-api/unity-api/classes/objecttransform) — the per-frame pose value (id, type, position, rotation, scale) streamed for each device
- [Class index](/docs/sdk-api/unity-api/classes) — all Unity SDK types
