hiukim/mind-ar-js

arSystem.pause(true) -> targetLost not calling

Opened this issue · 1 comments

On pause result was find, the camera still going and stop scanning, but targetLost event never calling. If i remove the pause function, both are calling perfectly.

const modelTarget = document.querySelector("#my-ar");
  modelTarget.addEventListener("targetFound", (event) => {
      console.log("TARGET FOUND");
      arSystem.pause(true); // pause AR, keep video
  });

  modelTarget.addEventListener("targetLost", (event) => {
    console.log("TARGET LOST");
    arSystem.unpause(); // unpause AR and video
  });

I think that's what the arSystem.pause() does. Since it's paused, it's not going to detect if a target was lost because it's not actively detecting anything at the moment.

What are you trying to do?