Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question ARTrackedImageManager different behavior on Android

Discussion in 'AR' started by DMurcia, Aug 13, 2021.

  1. DMurcia

    DMurcia

    Joined:
    Feb 18, 2021
    Posts:
    6
    Hi all!

    I have created a project with Unity 2020.3.3f1 and I am using AR Foundation 4.2.0-pre.4.

    In my script, I have associated the 'OnTrackedImagesChanged' event to a method. In it, I read all elements in eventArgs.added every time I capture an image, and depending on which it is, I execute one method or another.

    I need the images already captured to be able to be re-scanned and they appear again in the 'eventArgs.added' list. To do this, I disable and enable the "ARTrackedImageManager" component when necessary. This works perfectly for me in the Unity Editor, since when starting the component again, all the images that went through 'eventArgs.added', now go to 'eventArgs.removed', allowing me from that moment that when capturing an image, it appears in 'eventArgs.added'.

    My problem is that this behavior is not the same on Android. It seems that disabling and enabling the ARTrackedImageManager component is not enough to "removed" previously captured images.
    I have tried instead an 'ARSession.Reset()' to try to achieve the same objective, but the result is very erratic, sometimes I get it and sometimes not. Also, on some occasions, after launching the 'ARSession.Reset ()', something happens that prevents any image from being scanned from then on. At this point (Android), I have verified that all the necessary components are still enabled, but the method associated with the 'OnTrackedImagesChanged' event stops capturing images in added, updated or removed.

    Does anyone know of any other way to achieve the same result that I have in the Unity Editor but running the app on Android?

    Thanks in advance and greetings to all.

    PD: sorry for my very bad english :(