Welcome to the InsightXR Analytics SDK for Unity! This SDK seamlessly integrates into Unity projects, providing users with a unique VR analytics experience. With just a designated API Key, developers can effortlessly incorporate our SDK into their projects. Gain valuable insights into user experiences within virtual reality with our powerful analytics dashboard.
We have thoroughly tested these steps with Unity versions 2021.3.26f1 and higher. Follow the instructions to set up your VR project.
-
Install the Package from GitHub:
- Install the package via Git URL:
https://github.com/Insight-XR/Unity-sdk.git?path=src/InsightXRForUnity
- If you encounter SSL disconnect errors while installing the SDK, you can download the repository as a zip, extract it, then add the project from disk and select the
package.json
file in thesrc/InsightXRForUnity
folder.
- Install the package via Git URL:
-
Install Oculus Integration (Deprecated) or Meta XR Interaction SDK:
- If your Unity version is under 2021.3.26f1, install the Oculus Integration package: Oculus Integration
- For Unity 2021.3.26f1 and above, install the Meta XR Interaction SDK from the Asset Store: Meta XR Interaction SDK
-
Configure Project Settings:
- Go to
File > Build Settings > Player Settings > InsightXR
. - There are three fields: Customer ID, User ID, and API Key.
- Customer ID and API Key can be obtained from the dashboard.
- Ensure a unique User ID.
- Click Save.
- Go to
-
- Go to
File > Build Settings > Player Settings > Player
. Allow downloads over HTTP should
be changed toalways allowed
.
- Go to
-
Add the InsightTrackingManager Prefab:
- Search for the
InsightTrackingManager
prefab from the InsightXRReplayTool package and add it to your scene or scenes.
- Search for the
-
Configure Tracking Manager:
-
Add the
InsightSettingsSO
in theInsight Settings
field in theTrackingManager
script present in theInsightTrackingManager
. -
Assign the
InsightTrackCenterEye
andInsightTrackObject
to the camera GameObject. -
Assign the
InsightTrackHandAnchor
script andInsightTrackObject
to the left and right hand controllers.Make sure you assign which hand is right or left. If you are using AutoHands, tick the AutoHands field. -
For
AutoHands
, you have to add 3 lines in theFinger script
available in theAutoHands folder
. -
For any other objects you want to track, assign the
InsightTrackObject
to them.
-
-
Register Tracked Objects:
- In the Unity editor, click on
InsightXR > Manage Tracked Objects
. - Click on
Register Tracked Objects in Open Scene
andRegister Tracked Objects in Assets
.
- In the Unity editor, click on
-
Export Static Objects:
- Click on
Select Static Objects
. - In your hierarchy, there will be a GameObject with the scene name. Right-click on it and select
Export to FBX
. - Set the path to
InsightDeskCache/TrackedPrefabFBX/Models
. Ensure the export format is binary and embed textures are ticked. Click Export. Delete
the GameObject (the one you exported to fbx) from the hierarchy.
- Click on
-
Register Skybox: (if skybox present)
- If you have a skybox or multiple skyboxes, ensure it is a 6-sided skybox.
- Drag the material to the “Drag and Drop a 6-sided Skybox Material” field and click on
Register Skybox
for all your skyboxes.
-
Upload FBX Models:
- Before upload ensure that the
InsightTrackingManager
is present in the hierarchy and has theInsightSettingsSO
assigned. - Click on
Upload FBX Models
underInsightXR > Manage Tracked Objects
in the editor. This creates a zip folder of all the models and uploads it to the dashboard server.
- Before upload ensure that the
-
Start the Session:
- After models are successfully uploaded, you can start the session. The session starts recording, and when you stop the game, it will stop recording.
-
Local Replay:
- To play in local replay, copy the session ID from the sessions folder in assets or from the console.
- Search for the replay scene or find it in
Assets/Samples/InsightXRReplayTool/ReplayScene
. - Open the replay scene and click on
InsightReplayManager
in the hierarchy. - Enter the session ID in the session ID field in the inspector.
- Run the scene to play the local replay of your session.
-
Dashboard Replay:
- The same session with the same session ID will be present in the dashboard.
- Handles Failure Cases:
- If the network gets disconnected, the session is saved locally and then sent to the dashboard once the network is retrieved. It will try to send the failed data every minute periodically. If it fails to send it in the same session, it will send it in the next session.
- Supports:
- Multiple instantiation
- Late instantiation
- Hand animation
- Text tracking
- Multiple scenes
- Import Samples:
- You can import samples from our scenes and test them to know more about the SDK.
For more information, refer to our documentation and stay tuned for updates. Happy developing!