Could`t connect to camera in unity after one run.

Hi,

I’m building a project using Unity 6.3 and ZED SDK 5.2.0 (SDK on PC is 5.2.3, CUDA 13.2).

After setup, I imported some sample scenes (Object Tracking, Body Detection, and Point Cloud) and tried to run them. The first run in the Unity Editor always works fine. However, if I stop Play Mode and try to run the scene again, the ZED camera no longer works.

I receive the following error:

ZEDManager on ZED_Rig_Mono couldn’t connect to camera: CAMERA_ID_01. Check if another ZEDManager is already connected.
UnityEngine.Debug:LogError (object)
ZEDManager:Awake() (at ./Library/PackageCache/com.stereolabs.zed@…/ZEDManager.cs:2124)

The only ways I’ve found to fix this are:

  • Restart the entire Unity Editor, or

  • Do the following workaround:

    1. Change the camera ID to an incorrect one

    2. Run the scene

    3. Stop the scene

    4. Set the camera ID back to the correct one

    5. Run the scene again

This makes me think the camera is not being properly released when exiting Play Mode, but I’m not sure how to fix it.

The project is completely empty except for the ZED SDK samples, so there shouldn’t be any conflicts with other scripts.

Has anyone encountered this issue or knows how to properly release the camera between Play Mode sessions?