MLDepthCamera in Unity 6.2

Is the ML2 ToF depth camera still available via the MLDepthCamera object in Unity 6.2.

In the 1.7.0 MagicLeap Examples there is a DepthCamera Scene included that renders the depth data on a surface, however when building with Unity 6.2 and executing on ML2 MLDepthCamera.Connect() reports an error “wrong parameter”.

Switching to 2.6.0 the DepthCamera scene is even gone. Is the MLDepthCamera not available/implemented in later mlOS/Unity SDKs. If so, what is the latest version supporting MLDepthCamera?

Unity Editor version: 6000.2.9f1
ML2 OS version: 1.4.0 dev2
Unity SDK version: 1.7.0 / 2.6.0
Host OS: (Windows/MacOS) Win11

Error messages from logs (syntax-highlighting is supported via Markdown):

If you are using Unity 6.2 you should use the OpenXR API instead of the deprecated/legacy Depth Camera API. Here is a guide on how to get access to the Depth Stream:

Make sure the Pixel Sensor Feature is enabled in your Unity OpenXR Project Settings before deploying and that you have requested the proper permissions.

Hi kbabilinski,

thanks for the link to the article.

Unfortunately, I get constantly Unity editor crashes when running an example project after adding this version of DepthCameraExample.cs

Debugging into the code the following line causes the crash in DepthCameraExample::Start()

Permissions.RequestPermission(MagicLeap.Android.Permissions.DepthCamera, OnPermissionGranted, OnPermissionDenied,
OnPermissionDenied);

Tried with Unity simulator and MagicLeap Hub Application Simulator - same result. Will try with my ML2 headset as a next step.

Best regards,
Raimund

Please note that the deaf camera API is not supported in the app simulator, and that the simulator has been deprecated