> For the complete documentation index, see [llms.txt](https://docs.multiset.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.multiset.ai/unity-sdk/on-device-localization/on-device-object-tracking.md).

# On-Device Object Tracking

On-Device Object Tracking anchors your AR content to a physical object using the processing power of the device itself, with no per-frame network request. The object's tracking data is compiled into an offline bundle, cached locally, and matched on-device.

This works the same way as On-Cloud [Object Tracking](/unity-sdk/sample-scenes/modelset-tracking.md), but all matching happens locally. For the shared concepts (object codes, anchoring content under the object space), see the Object Tracking sample scene.

{% hint style="warning" %}
On-Device Object Tracking is an Enterprise feature and requires the **MultiSet-OnDevice.unitypackage**. See [Importing the On-Device Package](/unity-sdk/on-device-localization/importing-the-on-device-package.md).
{% endhint %}

### Prerequisites

* The **MultiSet-OnDevice** package imported into your project.
* Your app's **Bundle Identifier** registered on the Developer Portal (matching your Unity project, for both iOS and Android). See [Register Your App Identifier](/unity-sdk/on-device-localization/importing-the-on-device-package.md#register-your-app-identifier-bundle-id).
* One or more objects with **Object Tracking** active on the **MultiSet Developer Portal**, each with a processed **offline bundle**.

### Setup Guide

#### Step 1: Open the Sample Scene

Open the **OnDeviceObjectTracking** scene from **MultiSet-OnDevice/Scenes/OnDeviceObjectTracking**, and select the **OnDeviceObjectTrackingManager** GameObject in the Hierarchy.

#### Step 2: Configure Object Codes

On the **OnDeviceObjectTrackingManager** component, add the **Object Code(s)** you want to track to the **Object Codes** list. You can add a single code or multiple codes (the SDK will download and match each one).

> Object Codes are issued by the Developer Portal once Object Tracking is active for an object.

Key parameters of the [Object Tracking Manager](/unity-sdk/api-reference/modelsettrackingmanager.md):

| Parameter                                   | Description                                                          |
| ------------------------------------------- | -------------------------------------------------------------------- |
| **Object Codes**                            | One or more object codes to track.                                   |
| **Confidence Check / Confidence Threshold** | Reject matches below the confidence threshold.                       |
| **Background Tracking / Duration**          | Keep tracking running in the background for the configured duration. |
| **Retracking**                              | Resume tracking when the user returns to the object.                 |
| **Show Alert**                              | Show tracking success/failure UI alerts.                             |

#### Step 3: Anchor Your Content

Add your AR elements as children of the **objectSpace -> {ObjectCode} GameObject**, positioning your content relative to the object mesh, exactly as with On-Cloud Object Tracking. See [Object Tracking](/unity-sdk/sample-scenes/modelset-tracking.md) for details.

#### Step 4: Choose a Bundle Management Mode

Object tracking data is downloaded as an offline bundle. The **Offline Bundle Download Mode** setting controls how the device gets it.

**Option A: Editor Mode (Embedded)**

The bundles are downloaded in the Unity Editor and built into the application.

* In the Inspector, set **Offline Bundle Download Mode** to **Editor**.
* Click **Get Object offline Bundles & Metadata**. The SDK fetches each object's status and automatically downloads the available bundles and metadata into **StreamingAssets/ObjectData**.
* Wait for the status to report all objects downloaded successfully before building.

**Option B: Runtime Mode (On-Demand)**

The application is built without the object data; the SDK downloads each bundle from the MultiSet servers on first run and caches it on the device.

* In the Inspector, set **Offline Bundle Download Mode** to **Runtime**. No editor download step is required.

{% hint style="info" %}
In Editor mode, downloaded object bundles are stored at **StreamingAssets/ObjectData/{objectCode}.bytes** along with a matching **{objectCode}\_metadata.bytes** file. In both modes, files are cached locally and do not need to be downloaded again unless the object is updated.
{% endhint %}

### Licensing & First Run

As with On-Device Localization, the very first launch (or first initialization of the On-Device module) requires an active internet connection to verify your account and registered App Identifier and to download the object assets. This may take some time depending on the asset size. Subsequent runs work without internet, as the license token and assets are cached locally.

### Build

Before building, make sure the **OnDeviceObjectTracking** scene is added to your **Build Settings**, and that you have either downloaded the bundles (Editor mode) or selected Runtime mode. Then build for iOS or Android. See [Importing the On-Device Package](/unity-sdk/on-device-localization/importing-the-on-device-package.md) for native plugin details and [Building Steps](/unity-sdk/building-steps.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.multiset.ai/unity-sdk/on-device-localization/on-device-object-tracking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
