A Unity toolkit for building VR research experiments with high-quality data collection, experiment management, and HTC eye-tracking support.
Research XR Toolkit (RXT) was created to eliminate the repetitive work involved in building VR research experiments.
Instead of writing custom scripts every time you need to:
- Record participant data
- Save eye tracking
- Capture facial expressions
- Generate CSV files
- Randomize trials
- Manage participant IDs
- Play audio
- Trigger haptics
RXT provides a single API that handles these tasks automatically so researchers can focus on designing experiments rather than infrastructure.
RXT builds on top of SXR.
Check out the walkthrough video to see RXT in action and learn how the toolkit can be used to build and manage VR research experiments.
Watch the RXT Walkthrough on YouTube
- ✅ Automatic CSV data collection
- ✅ HTC Vive Focus Vision Support
- ✅ HTC Vive Pro Eye Support
- ✅ Eye Tracking
- ✅ Facial Tracking
- ✅ Camera Tracking
- ✅ Baseline Corrected Pupil Diameter
- ✅ Trial Summary Generation
- ✅ Timed Event Summary Generation
- ✅ Audio Manager
- ✅ Randomization Utilities
- ✅ Latin Square Generation
- ✅ Haptic Feedback
- ✅ Participant ID Management
Research XR Toolkit is distributed as a complete Unity project rather than a Unity package.
- Unity 6
- Git
- HTC OpenXR Plugin (included in this repository)
- SXR (included in this repository)
Clone the repository.
git clone https://github.com/JohnBacho/ResearchXRToolkit.gitOpen Unity Hub.
Select
Add → Add project from disk
Navigate to the cloned repository and select the project folder.
Unity Hub will recognize the project and open it using Unity 6.
Once the project finishes importing, open the sample scene or begin building your experiment.
RXT is built on top of the Simple XR (SXR) framework developed by Justin Kasowski.
SXR provides the core experiment framework including:
- Experiment state management
- Trial management
- Phase management
- Step management
- Timing utilities
RXT extends SXR by adding:
- Automatic data collection
- Eye tracking
- Facial tracking
- Trial summaries
- Event summaries
- Audio utilities
- Haptics
- Randomization utilities
- Participant management
Rather than replacing SXR, RXT expands it into a complete research toolkit.
The data collection system is the core feature of RXT.
Unlike many research frameworks that require manually constructing CSV files, RXT automatically records data every frame.
Each participant receives their own folder:
001/
Data_2026-08-04_14-52-33.csv
TrialSummary.csv
EventSummary.csv
No additional scripting is required.
The toolkit can automatically record:
SubjectID
Date
Time
Phase
Trial
Step
State
Unity Time
Position X
Position Y
Position Z
Rotation X
Rotation Y
Rotation Z
Combined Gaze Origin
Combined Gaze Direction
Left Pupil
Right Pupil
Combined Pupil
Baseline Corrected Pupil
Hit Object
Hit Position
All HTC OpenXR Eye Expression blendshapes including:
Blink
Wide
Squeeze
Up
Down
Left
Right
Every HTC Lip Expression value including:
Jaw
Cheeks
Tongue
Lips
Mouth
Puff
Stretch
Smile
Pout
Not every experiment needs every variable.
Each category can be enabled or disabled in the Unity Inspector.
Individual variables can also be toggled.
For example:
☑ Camera Position
☐ Camera Rotation
☑ Pupil Diameter
☐ Facial Expressions
Only enabled fields are written to disk.
This reduces file size and improves readability.
Recording data is as simple as:
rxt.StartRecording();Pause recording:
rxt.PauseRecording();The toolkit automatically:
- creates headers
- writes data every frame
- buffers writes for performance
- flushes data to disk
- safely closes files when the application exits
Sometimes researchers don't need every frame of data.
Instead they need a single average value for an entire trial.
Enable:
Generate Trial Summary File
RXT will automatically average every numeric value over the duration of the trial.
Example:
Trial
Average Pupil Diameter
Average Head Height
Average Blink Rate
Average Gaze X
Average Gaze Y
Text fields (such as object names or states) are preserved while numeric values are averaged.
No additional scripting is required.
Researchers often need to summarize a short event such as:
- watching a stimulus
- solving a puzzle
- pressing a button
- viewing an image
Instead of averaging an entire trial, RXT can average only a timed section.
Start collecting:
rxt.StartEventSummaryTimer(5f);This records data for five seconds.
When the timer ends, RXT automatically writes one summarized row into:
EventSummary.csv
You can also stop collection manually.
rxt.StopEventSummaryTimer();Many eye-tracking studies require baseline correction.
RXT performs this automatically.
Capture a baseline:
rxt.StartBaseline(2f);RXT stores pupil values for two seconds.
Afterward every recorded pupil diameter includes:
Current Pupil
Baseline
Baseline Corrected Pupil
Corrected = Current - Baseline
This allows researchers to analyze cognitive load rather than raw pupil size.
Participant IDs are handled globally. They are set using unique id manager but can be manually set using
rxt.SetUniqueID(42);Retrieve it later:
int id = rxt.GetUniqueID();Participant folders are automatically named using this ID.
Generate random integers.
int value = rxt.RandomizeInt(1,10);Generate randomized arrays.
int[] order = rxt.RandomizeIntArray(1,20,10);Latin Square ordering.
string[] order =
rxt.LatinSquare(
conditions,
participantID);Generate balanced trial orders.
string[] trials =
rxt.GenerateTrialOrder(
conditions,
repeats:3);Play a sound.
rxt.PlayAudio("Bell");Loop audio.
rxt.PlayAudioLooped("Ambience");Stop audio.
rxt.StopAudio("Ambience");Default vibration.
rxt.TriggerHaptic();Custom vibration.
rxt.TriggerHaptic(
amplitude:0.5f,
duration:0.25f);Current support includes:
- HTC Vive Focus Vision
- HTC Vive Pro Eye
The toolkit automatically switches between supported eye tracking systems depending on the selected headset.
The data collection system was designed specifically for research.
Rather than writing directly to disk every frame, RXT:
- Buffers CSV output
- Batches file writes
- Periodically flushes to disk
- Safely closes streams when the application exits
This minimizes disk overhead while maintaining data integrity.
RXT can be built for either PC VR using the HTC Vive Pro Eye or Android using the HTC Vive Focus Vision. The build process differs depending on the target headset.
The Vive Pro Eye uses a PC-based VR workflow.
- Open the RXT project in Unity 6.
- Open:
File → Build Profiles
- Select Windows as the target platform.
- Make sure the required RXT scenes are included in the build.
- Select Build.
- Choose an output folder for the application.
- Run the generated
.exeon the research computer. - Connect the HTC Vive Pro Eye to the computer and ensure the required HTC/VIVE software is running.
- Launch the RXT application.
The experiment runs directly on the PC while the Vive Pro Eye provides the VR display and eye-tracking data.
The Vive Focus Vision uses an Android-based build.
Before building, install and configure the required Android development tools and make sure ADB is available.
- Open the RXT project in Unity 6.
- Open:
File → Build Profiles
- Select Android as the target platform.
- Connect the HTC Vive Focus Vision to the development computer.
- Enable USB debugging on the headset if prompted.
- Verify that the headset is detected through ADB.
- Make sure the required RXT scenes are included in the build.
- Configure the Android build settings for the Focus Vision.
- Select Build And Run.
- Unity will build the Android application and deploy it to the connected headset.
The resulting application runs on the Focus Vision as an Android application.
| Target | Unity Platform | Headset | Build Output |
|---|---|---|---|
| PC VR | Windows | HTC Vive Pro Eye | .exe |
| Standalone VR | Android | HTC Vive Focus Vision | .apk |
The two headsets require different build targets. Do not build the Focus Vision application using the Windows target, or build the Vive Pro Eye application using the Android target.
For the Vive Pro Eye, build for Windows.
For the Vive Focus Vision, build for Android and use ADB to deploy the application to the headset.
Lead Developer
John Bacho
Faculty Advisor
Dr. Brian Thomas
Baldwin Wallace University
If you use RXT in your research, please cite this repository.

