> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/study-setup-and-design/virtual-reality/htc-focus-vision/htc-focus-vision-setup-guide-for-unity-environment.md).

# HTC Focus Vision - Setup Guide for Unity Environment

Add the iMotions Unity plugin to a Unity environment, build an APK for the HTC VIVE Focus Vision and import its eye tracking recordings into iMotions Lab.

*This article provides a step-by-step guide on using the VR Integration with a Unity environment for the HTC VIVE Focus Vision. The guide includes information on all the necessary steps and prerequisites for getting started*

### Prerequisites

* **Install Unity Hub:** Install Unity Hub from [here](https://docs.unity.com/en-us/hub/install-hub). The iMotions Unity plugin supports Unity 6 and Unity 2022.3, and has been tested on Unity 6000.6.9f1 and 2022.3.40f1. Install one of these versions through Unity Hub, or download it from the [Unity Archive](https://unity.com/releases/editor/archive).
* **VIVE Developer Setup:** Put on your VIVE Focus Vision, go to **Settings > General > About**, and click on the **Build Number** 7 times to enable Developer Mode. Ensure you have also installed the VIVE Hub or VIVE Manager app if you need to manage device settings externally.
* **Download SideQuest:** Download the SideQuest Desktop app to be able to load the Unity APK files onto the headset. You can download the app from here, [SideQuest](https://sidequestvr.com/setup-howto)
* **AVPro Capture Asset:** Make sure to purchase the full version of the AVPro Capture asset if you do not wish to use the trial version, which has a floating watermark on your environment at all times. The purchase removes this watermark permanently. This is used to capture the VR recording and is required. Purchase from here [AVPro Movie Capture - Mobile](https://assetstore.unity.com/packages/tools/video/avpro-movie-capture-mobile-edition-221852) (Make sure it's the mobile version)
* **Download the iMotions Unity Plugin:** Download the iMotions Vive Unity plugin from [here](https://github.com/imotions/iMotions-UnityPlugin/tree/vive-no-watermark)
* Any Unity environment you build yourself or find in the Unity asset store can be used with the integration. Please make sure the asset supports the Unity version you use.

### Unity Project Setup - Creating the project and setting everything up within Unity

1. Inside Unity Hub, create a new project using **Unity 6 (6000.6.9f1)** or **2022.3.40f1**.
2. Make sure to add Android build support under the left side of the Unity Hub window: Installs → Manage on the right side → Add modules and check on the Android build support
3. Go to **Window → Package Manager** and click on the **+** icon in the top left corner.
4. Choose **Add package from disk** and navigate into your saved iMotions Unity Plugin folder.

   > If you plan on using the trial version of the AVPro capture asset, make sure you import the package using URL instead of from disk inside of Unity. Paste the following URL when asked: <https://github.com/imotions/iMotions-UnityPlugin.git#vive> (The trial version has a floating watermark)
   >
   > Make sure to install Git first: [Git](https://git-scm.com/install/)
5. Click into the folder and select the `package.json` file to import it. Make sure to also import the samples from the plugin tab. **(Skip if you installed the Unity Plugin using URL)**
6. Once complete, go back to **Window → Package Manager**, locate the full AVPro Movie Capture asset (under *Packages: My Assets*), and import it into Unity. **(Skip if you installed the Unity Plugin using URL)**
7. At the top of your project window, click on VIVE → OpenXR installer and then click on “Install or Update latest version.”
8. Click on File at the top left corner → Build settings → Click on the Android icon → then click on switch platform

#### Android build settings

Go to Edit → Project Settings → Player → Other settings

1. Under Rendering → Color Space → Linear
2. Under Rendering → Uncheck or make sure Auto Graphics APIs is off → Move OpenGLES3 so it’s placed as the first option.
3. Under Identification → Minimum API level → Set it to Android 7.0 “Nougat” (API level 24)
4. Under Configuration →
   1. → Scripting Backend → IL2CPP
   2. → Target Architectures → ARM64

#### XR Plugin settings

1. Go to Edit → project settings → XR Plug-In Management
   1. Make sure that Open XR and VIVE XR Support feature group is checked on
2. Click on OpenXR under XR Plug-in Management
3. Make sure VIVE XR Support is enabled
4. Under OpenXR Feature groups, choose VIVE XR Support
5. Make sure VIVE XR Eye Tracker is checked on
6. Make sure that VIVE XR support is checked on
7. At the top, under “Enabled Interaction Profiles,” Click on the + and make sure Eye gaze Interaction Profile is chosen
8. In the same location, make sure that VIVE Focus 3 Controller Interaction is also chosen

***

### Creating a Unity APK file

1. In the Project window, navigate to **Assets → Scenes**.
2. Navigate to the iMotions sample scenes folder (e.g., `Samples → iMotions VIVE Plugin → 1.0.10 → EyeTracking Data Export Example → Scenes`) and open that SampleScene.
3. Copy the **iMotions-Systems-Vive** and **XR Origin (XR Rig)** objects by highlighting them and pressing Ctrl+C.
4. Go back to your Unity Environment scene and paste them in.
5. Click into the **iMotions-System-VIVE** object and locate the **VideoCapture** object.
6. Click **Add Component** and choose **AVPro Movie Capture → Capture From Camera**.

### Build the APK file

*Make sure that the environment can be played inside Unity*

1. Click on File in the top left corner and choose Build Settings
2. Click on Add Open Scene and make sure it's the Scene of your environment
3. Click on Build and save the APK somewhere safe

## Loading the APK onto the VIVE Focus Vision

1. Open **SideQuest** on your PC.
2. Connect your VIVE Focus Vision via a USB-C to USB-A cable. Ensure you click "Allow USB Debugging" inside the headset if prompted.
3. Verify SideQuest shows a green connection dot in the top left corner.
4. Click the **"Install APK file from folder on computer"** icon (box with a downward arrow) in the top right. Select your built APK.
5. Put on the headset. Open your **App Library**, select the filter dropdown (usually top right), and select **Unknown Sources** to find and launch your Unity app.

### Capturing, Recording, and Saving the Data

1. Once the environment is running on the VIVE Focus Vision, you can start recording by clicking the **Grip Button** on your right controller (the button that rests under your middle finger).

   ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-9fa1f147d9fdd837c573e7bb7724a1bfcba97e68%2F26a03ef218_image-UY2MAKTI.webp?alt=media)
2. To end the recording, click the Grip Button again. This saves the screen recording and the CSV eye-tracking data.
3. To retrieve the data, plug the headset back into your PC and open SideQuest.
4. Click the **"Manage Files on the headset"** icon (folder icon) in the top right.
5. Navigate to: `Android → Data → [Your Unity Project Name] → Files → iMotions`.
6. Click the floppy disk save icon next to the folder to download the data to your PC.

### Loading the APK into the headset and exporting the recordings

This video guide shows you how to load the APK file onto the headset using SideQuest and how to extract the recordings afterwards

{% embed url="<https://files.imotions.com/hc_articles/videos/tutorial2final.mp4>" %}

### Importing recordings into iMotions

Once you have saved the recording folder to the PC, do the following:

1. Inside iMotions, click on the blue “create new study” Icon
2. Choose “Virtual Reality (VR)”
3. Choose “Import VR Recordings”
4. Select the “HTC VIVE Focus Vision”
5. New study and import the recordings folder.

When you import the recording, make sure to place the study files folder containing the capture video and the CSV file inside an import folder so it looks like this: ![](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-885d937ccb3dc75d575083c4a56ea47b75100731%2F10bff25f01_image-Q28B5VNV.webp?alt=media)

You will need to choose the Import folder to import:

![The dialog for importing HTC VIVE Focus Vision data, with the data folder filled in](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-fd198fd767f8af3a6ad85c5691256535beb58a89%2Flab_import_htc-vive-focus-vision-data-folder.png?alt=media)

> It’s important to ensure that the Eye Tracking data file is formatted correctly. The decimal separator needs to be a dot, and not a comma.
>
> <img src="https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-0bfd11839c6650f0598e1a625c71cf3e31476590%2F79438fd384_image-WIKPAN2W.png?alt=media" alt="" data-size="original">


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/study-setup-and-design/virtual-reality/htc-focus-vision/htc-focus-vision-setup-guide-for-unity-environment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
