Magic Leap MRTK 3 Settings
The Magic Leap MRTK 3 package adds additional, Magic Leap specific, options to MRTK's Settings allowing you to enable or disable specific features based on their preferences.
Open Magic Leap Settings
This sections includes instructions on how to open the MRTK Magic Leap Settings window.
- Open the Project Settings window by navigating to Edit > Project Settings. Then, from the sidebar, select MRTK3 > Magic Leap Settings.
- Here you can modify which prefabs are created at runtime to visualize the Magic Leap 2 controller and hands. Additionally, you can change the input action bindings if needed.
MRTK XR Rig Runtime Configuration
The Magic Leap MRTK 3 settings allow developers to enable Runtime Configuration of the MRTK XR Rig. This package is an optional way to configure the MRTK XR Rig to be compatible with Magic Leap 2's input, eliminating the need to manually modify the MRTK XR Rig prefab.
The Runtime Config Enabled option will only take effect in the editor if the Magic Leap App Simulator is active in the XR Plug-in Management. Follow these steps to modify the settings
Manual MRTK XR Rig Configuration
If you choose not to use the Runtime Configuration, you will have to modify the existing MRTK XR rig by either replacing it or altering its input actions.
- Use 'MRTK XR Rig - MagicLeap' Prefab
- Manually Edit the `MRTK XR Rig`
- Delete the existing MRTK XR Rig if one exists.
- Navigate to the
Packages/Magic Leap MRTK3/Runtime/MagicLeap/Prefabs/MRTK_Variants/
directory - Add the
MRTK XR Rig - MagicLeap
prefab to your scene.
- Select the MRTK XR Rig in the scene. Add the MagicLeapInputs and MagicLeapHandAuxiliaryInputs input action assets to the Input Action Manager.
- Expand the object so that the MRTK RightHand and MRTK LeftHand Controllers are visible (
MRTK XR Rig/ Camera Offset/
). - Add the
Packages/Magic Leap MRTK3/Runtime/MagicLeap/Prefabs/MRTK_Variants/MRTK MagicLeap Controller
prefab into the XR rig to add support for MagicLeap controller input. - Select each of the Hand Controller objects and update the following components:
- Update the Articulated Hand Controller to use equivalent
MagicLeapHandAuxiliaryInputs
inputs instead of the generic MRTK bindings. For example, the left hand bindings would be the following in order:Aux LeftHand/DevicePosition
Aux LeftHand/DeviceRotation
Aux LeftHand/TrackingState
Aux LeftHand/Select
Aux LeftHand/Select Value
- Remove actions that do not have matching values. For the left hand, these values would be:
MRTK LeftHand/Activate
MRTK LeftHand/UI Press
MRTK LeftHand/Rotate Anchor
MRTK LeftHand/Translate Anchor
- Update the Articulated Hand Controller to use equivalent
- Replace the input binding on each of the hand's child objects so they target the
MagicLeapHandAuxiliaryInputs
input actions.- Select the IndexTip PokeInteractor then expand the Poke Pose Source/Pose Source List. Replace Element 1, to use Tracking State and PointerPosition/Rotation actions.
- Select the Far Ray then select the Aim Pose Source Pose / Source List. Replace Element 0, to use Tracking State and PointerPosition/PointerRotation actions.
- Select the Far Ray then select the Device Pose Source / Pose Source List. Replace Element 0 to use Tracking State and DevicePosition/DeviceRotation actions.
- Select GrabInteractor then select the Pinch Pose Source / Pose Source List. Replace Element 1 Tracking State and PointerPosition/PointerRotation actions.
- Select the GazePinchInteractor and Replace the Device Pose Source (DevicePosition/Rotation), and Aim Pose Source (PointerPosition/Rotation).
- Finally, select the Main Camera, then add the MagicLeap Camera component. (Optional)