Eye tracking and Image Tracking in ml2

Unity Editor version: 2022.3.44f1
ML2 OS version:1.9.0

I have a project where both eye tracking and image tracking are needed, however I could make the eye tracking work perfectly with openXR, while the image tracking is working well with MLSDK. Is there a way to make them both work as intended?

You cannot obtain input from both OpenXR and MLSDK at the same time. The input devices / subsystems are managed through unity depending on the XR Loader.

If you need to use the MLSDK , you can checkout the MLSDK samples by downloading the Magic Leap Unity Examples v 1.12.0.

When you say “image tracking” are you referring to marker tracking?

Thanks for the reply. And no, I need to recognise images, and for this I used Vuforia, which worked great. However, that is only working with MLSDK. And for the same project I need eye tracking as well. In consequence, is there a way to make the eye tracking work with MLSDK as well, as it has only worked with OpenXR for me.

Thank you for that additional information.

Have you looked at the version 1.12.0 of the Magic Leap 2 Unity examples project. This project includes an eye tracking scene.

You can also see the MLSDK eye tracking documentation from our developer portal here:

I did look at the example, however it is also using OpenXR. And when I try to access the libraries suggested for MLSDK for eye tracking from the documentation, it seems they are not recognized.
That is why I'm confused whether I'm missing some other plugin maybe.

Please make sure to use the the older version of the examples. The older example project is pre-configured for MLSDK

Note, after version 1.12.0 the updates to the SDK were for OpenXR functionality. If you do choose to upgrade the SDK, make sure to re-install the com.unity.xr.magicleap package from the package manager and enable the Magic Leap XR Loader from the XR Plug-in management window inside your Project's Settings.

You will need to add using UnityEngine.XR.MagicLeap; and using UnityEngine.XR; to the top of your script to access functions like:

InputSubsystem.Extensions.MLEyes.StartTracking();

and

if (!eyesDevice.isValid)
{
    this.eyesDevice = InputSubsystem.Utils.FindMagicLeapDevice(InputDeviceCharacteristics.EyeTracking | InputDeviceCharacteristics.TrackedDevice);
}