Search Unity

Question ARFoundation Image tracking manager Detects images from other scenes

Discussion in 'AR' started by Dev-SatoriXR, Feb 11, 2021.

  1. Dev-SatoriXR

    Dev-SatoriXR

    Joined:
    Oct 16, 2019
    Posts:
    7
    Good Day,

    I need some help on this ARFoundation image tracking issues, I have two scenes (A and B) with two different image libraries with different images on each libraries.

    When I start scene A, The tracking works correctly, but then If i go to Scene B from A, The Image tracking manager starts to track the image target from scene A.

    I don't know whats going wrong in this, Both the images used for tracking are perfectly distinct from each other (For eg, Image A is like an art and Image B is like a QR code kind of image)

    Thanks in-advance.
     
  2. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    @vibromech ARFoundation doesn't look at 'Scenes'.
    The subsystems run seperately from your UnityScenes. The ImageLibraries are forwarded to ARCore/ARKit on initialization. ALL images are thus ALWAYS tracked.
    What you can do is keep your own list, and skip any images that you're not tracking in your current scene.
    Another solution might be to stop/destroy your (image)subsystems before switching scenes.
     
  3. Dev-SatoriXR

    Dev-SatoriXR

    Joined:
    Oct 16, 2019
    Posts:
    7
    I think I have found whats happening, Even across scenes with different libraries, The app takes the first image that is scanned and uses that detection across all the scenes...For example, I scanned a image marker in Scene A and After detection it will take me to scene B, What's happening in Scene B is, Instead of waiting for a detection of the image, The app just directly spawns the model (Keeping the first scanned image in its reference)...The spawning happens in the instant right after the Scene B loads.
     
  4. FrankvHoof

    FrankvHoof

    Joined:
    Nov 3, 2014
    Posts:
    258
    If it's the same image, then yes. It's not 'keeping the reference'. It's just updating the image that it sees.
    Again: ARFoundation (ARCore/ARKit) doesn't actually care about your scenes. The image is still there and visible to the device's camera, so it's updated.
     
  5. Dev-SatoriXR

    Dev-SatoriXR

    Joined:
    Oct 16, 2019
    Posts:
    7
    I got it working...Whenever I want to change the scene, I had to unload the XRloader --> change the scene --> Initialize the loader again.
     
    Last edited: Mar 1, 2021