> 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/varjo/how-to-varjo-with-eye-tracking-older-integration-only-vr1-and-vr2-unity.md).

# How to: Varjo with eye tracking - (older integration) Only VR1 and VR2 Unity configuration

Configure a Unity project with the older iMotions Varjo integration to stream Varjo VR-1 and VR-2 eye tracking into an iMotions Lab VR study.

*This article contains information on how to enable eye tracking into a virtual reality environment, created with Unity.*

## Prerequisites

* Varjo headset VR-1 or VR-2 (VR-2 Pro). For the Aero, VR-3, XR-3 and XR-4, use the [Varjo Aero/VR3/XR3](https://help.imotions.com/lab/study-setup-and-design/virtual-reality/varjo/varjo-aero-vr3-xr3-set-up-how-to-get-system-and-unity-project-ready-for-imotions.md) or [Varjo XR4](https://help.imotions.com/lab/study-setup-and-design/virtual-reality/varjo/varjo-xr4-set-up-how-to-get-system-and-unity-project-ready-for-imotions.md) set-up article.
* A computer that meets the minimum recommended specifications for CPU and GPU for the Varjo headset you have.
* Following the instructions on the Varjo website to set up your PC and environment, download the required software. <https://support.varjo.com/hc/en-us/system-requirements-for-xr-1-de-vr-2-pro-vr-2-vr-1>.
  * You have set up and installed all the hardware including base stations, controllers, and computers.
  * SteamVR via [Steam](https://store.steampowered.com/).
  * Varjo Base, which you can download directly from Varjo by [logging into your account](https://account.varjo.com/login). You need version 3.1.0.0 or newer, but older than 3.8: Varjo Base 3.8 and newer no longer support the VR-1 and VR-2. If it is an older version, you have to fully uninstall it and redownload.
* Unity (**Version 2020.3.x** - **any of the 2020.3 versions will do**). Note that this setup will only reliably work with these versions of Unity. Running outside parameters risks stability. We recommend downloading the 2020.3.30f1 version, as this is the version we have validated with the iMotions-Varjo-Unity package.
* [iMotions Lab](https://help.imotions.com/lab/getting-started/download-and-install-imotions.md)
* The iMotions Unity package - note that this package contains the Varjo plug-in as well: [iMotions Varjo Integration v2.1.5](https://github.com/imotions/iMotions-UnityPlugin/tree/varjo-2.1.5). You install it in Unity straight from GitHub (see the steps below), which needs [Git](https://git-scm.com/downloads) installed on the computer. Don't install the Varjo XR Plugin from Varjo's GitHub: the package installs Varjo XR Plugin 2.3.0 by itself, and newer versions (3.3.0 and later) no longer support the VR-1 and VR-2.

***Optional:***

* If you want to do hand tracking, download the LeapMotion plug-in from here: <https://github.com/varjocom/XR3-VR3-UnityModules> - Download as zip (under “Code”) and extract all.

## Steps

1. Create a new Unity 2020.3 project.
2. In Unity, go to **\[Window]->\[Package Manager]**, click the top left **\[+]** and choose **\[Add package from git URL]**. Paste `https://github.com/imotions/iMotions-UnityPlugin.git#varjo-2.1.5` and click **\[Add]**. Don't add the Varjo XR Plugin yourself first: the package installs the Varjo XR Plugin and the iMotions Integration Core by itself.
3. In the Package Manager, select **\[3SL: iMotions Varjo Integration]**, open **\[Samples]** and click **\[Import]** next to the samples that match your project's render pipeline (Built-in, URP or HDRP).
4. Go to **\[Edit]->\[Project Settings]**, and in **\[XR Plug-in Management]**, check **\[Varjo]**. Under **\[3SL]**, in the iMotions Varjo Integration, choose your headset (VR-1 or VR-2) in **\[Target Headset Model]**.
5. Open one of the sample scenes under **Assets/Samples/3SL\_ iMotions Varjo Integration**, or add the integration's prefabs to your own scene. The [Setting up the iMotions-Unity package for Varjo headsets](https://help.imotions.com/lab/study-setup-and-design/virtual-reality/varjo/setting-up-the-imotions-unity-package-for-varjo-headsets.md) article describes the samples and prefabs.

{% hint style="info" %}
A few errors can appear in the Console while the bundled packages are still installing. They clear on their own. If they don't, save your project and restart Unity.
{% endhint %}

## Build Project

Before you build, go to **\[Edit]->\[Project Settings]->\[Player]->\[Resolution and Presentation]** and check **\[Run In Background]**. Without it, Unity pauses when its window loses focus, for example when you click on iMotions, and iMotions stops receiving gaze data (the eye tracker shows 0 Hz).

![varjo9.png](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-fad37916cd670d35850ca598f2209ee96e3f548f%2Fbeab3185ac_varjo9.webp?alt=media)

## Setting up a Varjo VR study in iMotions

After building the project you have an executable that can be used with iMotions. To collect data in iMotions with a VR environment, both must be running on the same computer.

1. In iMotions Global Settings > Eye tracking tab, check "Eye Tracking Server", select "Varjo VR", and enter "127.0.0.1:4050" as the Host Address. ![The Eye tracking tab of Global Settings with Varjo VR selected](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-3231a282c20257a972c82749e0847bfbb801a161%2Flab_global-settings_eye-tracking_varjo-vr.png?alt=media)
2. In Slide Show settings, select the Screen that will have the VR environment displayed

   ![The Slide Show tab of Global Settings with the screen for the slide show](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-29701e3abb461c902e17cb282c05cd74f1995509%2Flab_global-settings_slide-show_screen.png?alt=media)
3. In Stimuli settings, set "Capture rate" to 30 fps (recommended)

   ![The Stimuli tab of Global Settings with the capture rate at 30 fps](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-2d33b040a5fb34b8d6bea37815879585ee9c3b70%2Flab_global-settings_stimuli_screen-recording.png?alt=media)
4. Click the "Create study" button and select "Virtual Reality", "Unity", and "Eye tracking: Varjo VR"

   ![The study wizard with Virtual Reality (VR) selected as the study type](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-b0471081753e471fd5bcff85e59d2b5e0da1eebe%2Flab_study-wizard_study-type_vr.png?alt=media) ![The Select VR type page of the study wizard with Unity selected](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-27ad5aeb82f79c2b5f99f7f330b92ed2b5b00e07%2Flab_study-wizard_vr-type_unity.png?alt=media) ![The Select sensors page of the study wizard with Varjo VR selected for eye tracking](https://286068319-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNLNBWkNpljDaAj5rQtNa%2Fuploads%2Fgit-blob-70fb4969028b9d9f8e7579d77a5077f2c2b5cf46%2Flab_study-wizard_sensors_vr-unity-varjo.png?alt=media)
5. Run the Unity executable (e.g. architecturedemo.exe) and initiate eye tracking in the Unity environment
6. In the iMotions drop-down menus, click "Preferences > Reconnect sensors" to begin streaming eye tracking data from the Unity environment, which should report \~100Hz in the sensor preview widget (note: dots showing detected eye location will not appear).
7. Create respondents and make sure iMotions is recording the monitor in which the Unity program will be running, and then start recording.
8. Maximize the Unity window for the Screen Recording.
9. Press F1 to initiate calibration (the "Calibration Shortcut" in the iMotions Varjo Integration settings, F1 by default).
10. Confirm with the button on top of the HMD.
11. Respondent goes through calibration, when done system will automatically return to the Unity environment.
12. Data is being recorded with eye tracking.
13. After completing your study - press the End-slide button in iMotions. This will move on to the next stimuli, or end the recording if no more stimuli are included in the study.


---

# 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/varjo/how-to-varjo-with-eye-tracking-older-integration-only-vr1-and-vr2-unity.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.
