mixed-reality

MRTK

Use the MixedRealityPlayspace class from MRTK for Unity and set the Target Scale to Seated:

MRTK settings window

MRTK should handle the position of the playspace and camera automatically, but it’s good to double check:

MRTK playspace

  1. From the Hierarchy panel, expand the MixedRealityPlayspace GameObject and find the Main Camera child object
  2. In the Inspector panel, find the Transform component and change the Position to (X: 0, Y: 0, Z: 0)

XR SDK

Set your tracking origin mode on the XRInputSubsystem. After obtaining the subsystem, call TrySetTrackingOriginMode:

xrInputSubsystem.TrySetTrackingOriginMode(TrackingOriginModeFlags.Device);

And work with Unity’s XRRig.

XR rig in hierarchy

Legacy WSA

  1. Go to Other Settings section of the Windows Store Player Settings
  2. Choose Windows Mixed Reality as the device, which may be listed as Windows Holographic in older versions of Unity
  3. Select Virtual Reality Supported

Since the Main Camera object is automatically tagged as the camera, Unity powers all movement and translation.

[!NOTE] These settings need to be applied to the Camera in each scene of your app.

By default, when you create a new scene in Unity, it will contain a Main Camera GameObject in the Hierarchy which includes the Camera component, but does not have the settings below properly applied.

Namespace: UnityEngine.XR
Type: XRDevice

To build an orientation-only or seated-scale experience, you need to set Unity to the Stationary tracking space type. Stationary tracking space sets Unity’s world coordinate system to track the stationary frame of reference. In the Stationary tracking mode, content placed in the editor just in front of the camera’s default location (forward is -Z) will appear in front of the user when the app launches.

XRDevice.SetTrackingSpaceType(TrackingSpaceType.Stationary);

Namespace: UnityEngine.XR
Type: InputTracking

For a pure orientation-only experience such as a 360-degree video viewer (where positional head updates would ruin the illusion), you can then set XR.InputTracking.disablePositionalTracking to true:

InputTracking.disablePositionalTracking = true;

For a seated-scale experience, to let the user later recenter the seated origin, you can call the XR.InputTracking.Recenter method:

InputTracking.Recenter();

If you’re building a seated-scale experience, you can recenter Unity’s world origin at the user’s current head position by calling the XR.InputTracking.Recenter method.