# Installation

The MOTAR SDK for Unity is compatible Unity Editor version **2022.3+ LTS**

The **MOTAR SDK for Unity** is hosted on a publid NPM Registry and is **installed** via the Unity Package Manager as a **Scoped Registry.**

{% hint style="info" %}
For a detailed guide on installing packages via a Scoped Registry, see: [detailed-scoped-registry-instructions](https://docs.motar.com/how-to/motar-core-services/using-motar-sdk/motar-sdk-for-unity/installation/detailed-scoped-registry-instructions "mention")
{% endhint %}

<table data-header-hidden><thead><tr><th></th><th width="454"></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>MOTAR</td><td></td></tr><tr><td><strong>URL</strong></td><td>https://registry.hub.motar.com</td><td></td></tr><tr><td><strong>Scope(s)</strong></td><td>com.motar</td><td></td></tr></tbody></table>

## Samples

The MOTAR SDK for Unity includes some sample packages in the **Samples** section under the MOTAR entry in the Package Manager. These include:

* Device Sync
* Avatar
* Learn to Fly UFO (URP Only)

To **install** these samples:

* **Select** the MOTAR Package in the Package Manger
* **Click** "Samples"
* **Click** "Import" on the samples you would like to **install**.

<figure><img src="https://540871446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVJV84grXWXSLppsAzVKx%2Fuploads%2FyTu7nwobSdPyfytNvsi7%2Fimage.png?alt=media&#x26;token=a31ef94f-2c40-415b-810e-8c0bd220071f" alt=""><figcaption></figcaption></figure>

*Details about these sample packages are listed in the sections below.*

### Device Sync

{% hint style="danger" %}
**Required sample!**

Device Sync is **required** if your application will sync with the MOTAR Instance hosted by your organization.&#x20;
{% endhint %}

**Device Sync** allows users to sync their headset with the MOTAR Instance hosted by your organization.&#x20;

*When a user syncs their device, you can access user information via the* [*MOTAR User Profile Class*](https://docs.motar.com/how-to/motar-core-services/using-motar-sdk/motar-sdk-for-unity/motar-classes) *and leverage user data in your applications.*

#### Installing Device Sync

Device Sync is a Sample package located in the Dynepic/MOTAR SDK registry.

* After **installing** the SDK, **go to** the Package Manager
* **Click** the Dynepic / MOTAR SDK package entry
* Click **Samples** and locate **Device Sync**
* **Click** Install

In your project you should now see a **Samples** folder containing the MOTAR SDK Device Sync files.

After device sync imports, the sample will be **installed** in&#x20;

* **Assets\Samples\MOTAR SDK\\\<version>\Device Sync**&#x20;

Included with the scripts is the scene **MOTARDeviceSyncAndAuthentication**

{% hint style="warning" %}
If you don't have **TextmeshPro** installed in your project, it will install automatically request an install when opening the Sync scene.

* From your project window, navigate to Assets -> Samples -> MOTAR SDK -> \[version #] -> Device Sync -> Scenes.
* Double click and load “MOTARDeviceSyncAndAuthentication”.
  {% endhint %}

The **MOTARDeviceSyncAndAuthentication** scene allows users to log into their MOTAR accounts and authorize the headset.

The scene is automatically inserted into your Unity Build settings Scenes as the **FIRST** (0) scene.

<figure><img src="https://540871446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVJV84grXWXSLppsAzVKx%2Fuploads%2FwFzkhut10b1RXspcfdxA%2Fimage.png?alt=media&#x26;token=b236a52d-d03f-4eaa-9d09-920b17256468" alt="" width="482"><figcaption></figcaption></figure>

Generally, you should **authenticate** your users before they enter your application. If your app requires a different scene to be the first launched, simply move the **MOTARDeviceSyncAndAuthentication** to the required order.&#x20;

{% hint style="warning" %}
Moving **MOTARDeviceSyncAndAuthentication** means your application will not be authenticated or synced with MOTAR until the scene is launched. Attempts to access user information will be impacted.
{% endhint %}

### Avatar

The MOTAR Avatar **sample** makes development even easier with out-of-the-box XR features.&#x20;

With the Avatar sample package you get:

**MOTAR\_Player -** This XR Rig prefab is wired up ready for you applications. Show user's name, profile image. Locomotion, Interaction, and Camera fading are all built in and accessible.

**MOTAR\_TeleportAnchor -** Add teleportion anchors to your scenes

**AvatarDemoScene -** This demo scene shows you examples of the MOTAR Avatar, object interactions, UI, and Locomotion.&#x20;

### Learn to Fly UFO

The *Learn to Fly UFO* sample package is a fun and interactive way to explore the features of the MOTAR SDK. Whether you're new to Unity or just curious, this sample project guides you through the basics of integrating MOTAR Core and Avatar features from start to finish. **No prior experience required**—just dive in and start experimenting!

{% hint style="warning" %}
The UFO project is meant for Unity **beginners** to see how easy it can be to create an app using the MOTAR SDK for Unity.
{% endhint %}

Follow the tutorial: [learn-to-fly-ufo-xr-app-build-tutorial](https://docs.motar.com/welcome/commercial-use-installation-and-setup-tutorial/learn-to-fly-ufo-xr-app-build-tutorial "mention")
