Unity Testing with Mock HMD
In depth learning on Creating a Motive Powered Unity Project can be found in this course in Motive Academy.
If you are looking to test a Unity scene and you don’t have a headset nearby to test with, no worries. We can download a sample that is included in a Unity package already included as a dependency in Motive Unity projects.
In your Unity project click Window > Package Manager > XR Interaction Toolkit > Samples
Choose the Import button next to XR Device Simulator:
Under Assets > Project Settings > XR Plug-in Management, toggle your Plug-in Providers to just Mock HMD Loader:
Open the XR Interaction Toolkit tab and toggle Use XR Device Simulator in scenes to True and set the XR Device Simulator prefab to XR Device Simulator:
Next, in your Project tab search for the newly downloaded XR Device Simulator prefab and drag and drop it into your Init scene in your project's Scene Hierarchy:
Expand the XR Toolkit Player prefab in your scene Hierarchy
Select the XR Origin game object
Alter the height of this game object so it is at an appropriate head height:
Tip: Before you hit the play button and test your scene I recommend you set it up so the Game View will maximize on play.
Now when you hit play you should be met with a view similar to this:
If it shows the sight out of both “Eyes” make sure to hit the drop-down near the top middle of your screen and set it so the camera view shows just the Left or Right Eye.
You can now customize your controls how you like by altering XR Device Simulator Controls which can be found in your Project window.
But, by default, you can control your avatar with WASD to walk and Q/E to hover higher/lower. Then use Tab to rotate through both of your player's hands. While controlling a hand Left-click acts as your select/use button and G acts as your grab button.