Follow this step-by-step tutorial to add and automatically configure Mixed Reality Toolkit in your Unity project. It’s also possible to work directly with the MixedRealityPlayspace class from MRTK for Unity and set the Target Scale to World:
MRTK should handle the position of the playspace and camera automatically, but it’s good to double check:
Set your tracking origin mode on the XRInputSubsystem. After obtaining the subsystem, call TrySetTrackingOriginMode:
xrInputSubsystem.TrySetTrackingOriginMode(TrackingOriginModeFlags.Device);
xrInputSubsystem.TrySetTrackingOriginMode(TrackingOriginModeFlags.Unbounded); // Recommendation for OpenXR
You can use ARSession for HoloLens applications, which works better with anchors and ARKit/ARCore.
[!IMPORTANT] AR Session and related features need AR Foundation installed.
It’s also possible to apply the camera changes manually without using ARSession:
In the Inspector panel, find the Transform component and change the Position to (X: 0, Y: 0, Z: 0)
Camera in the Inspector pane in Unity
In the Inspector panel, find the Transform component and change the Position to (X: 0, Y: 0, Z: 0)
Camera in the Inspector pane in Unity
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 may not have the settings properly applied.