Unity

This guide provides detailed instructions to download, set up, and run the AMFITRACK SteamVR driver in Unity 6.

Prerequisites

Before you begin, ensure the following prerequisites are met:

Unity Setup

Follow these steps to set up Unity, install the SteamVR plugin, and add a Tracked Pose Driver. These instructions are based on Unity 6.

Create a New Unity Project

  1. Open Unity Hub and click New Project.

  2. Select the 3D template.

  3. Name your project (e.g., SteamVR_Setup) and click Create.

  4. This guide has been tested with Unity 6.

Install the SteamVR Plugin

  1. Open the Unity Asset Store:

  2. Search for SteamVR Plugin:

    • Look for “SteamVR Plugin” by Valve Corporation.

  3. Download and Import:

    • Click Download, then Import to add the plugin to your Unity project.

    • Ensure all required assets are selected in the import dialog and click Import.

  4. Configure the Project:

    • After importing, Unity may prompt you to configure OpenVR settings.

    • Accept the changes, such as enabling Virtual Reality Supported in XR Settings.

Configure XR Plug-in Management

  1. Open the Project Settings:

    • Go to Edit > Project Settings.

  2. Enable XR Plug-in Management:

    • In the Project Settings window, navigate to the XR Plug-in Management section.

    • Under the PC, Mac & Linux Standalone tab, enable OpenXR.

  3. Set the OpenXR Runtime to SteamVR:

    • Still under the OpenXR settings, locate Play Mode OpenXR Runtime.

    • Set it to SteamVR to ensure compatibility with the SteamVR runtime.

Set Up an Object with Tracked Pose Driver

  1. Create a 3D Object:

    • In the Hierarchy window, right-click and select 3D Object > Cube (or any object of your choice).

  2. Add the Tracked Pose Driver Component:

    • Select the object in the Hierarchy.

    • In the Inspector, click Add Component.

    • Search for and select Tracked Pose Driver.

  3. Configure the Tracked Pose Driver:

    • Set the Device and Pose Source according to your setup: - Example: Set Device to Generic XR Controller and Pose Source to Left controller.

    • This ensures the object follows the motion of your VR device (e.g., HMD or controllers).

Run the Scene

  1. Connect your VR headset and launch SteamVR.

  2. In Unity, press the Play button to test your scene.

  3. The object with the Tracked Pose Driver should now follow the motion of your VR device.

Troubleshooting

  • SteamVR Plugin Not Found:
    • Ensure you are logged into the Unity Asset Store and have an active internet connection.

  • Tracked Pose Driver Does Not Work:
    • Verify the Device and Pose Source settings in the Tracked Pose Driver component.

    • Ensure SteamVR is running, and your VR headset is properly connected.

Additional Notes

  • These instructions are specific to Unity 6. If you are using a different version, some steps or UI elements may differ.

  • For more information, refer to the official Unity documentation.