Search Unity

Bug AR Foundation - marker never picks up on first scan

Discussion in 'AR' started by Blinxel_AR, Feb 9, 2021.

  1. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    This ONLY happens in Android.
    Static markers seem to work much better than dynamic ones.
    Does anyone know why this might be the case?

    What could I be doing wrong with dynamic marker loading that might cause the markers to not pick up when the app first boots?

    Code (CSharp):
    1. IEnumerator ScheduleSetupTrackedImageManager(){
    2.     while(ARSession.state < ARSessionState.SessionInitializing) yield return null;
    3.     var runtimelib = trackedImageManager.CreateRuntimeLibrary();
    4.     var mutlib = runtimelib as MutableRuntimeReferenceImageLibrary;
    5.     Unity.Jobs.JobHandle handle = mutlib.ScheduleAddImageJob(markerTexture, markerTexture.name, markerTextureWidth);
    6.     while(!handle.IsCompleted) yield return null;
    7.     SetupTrackedImageManager(mutlib);
    8.   }
     
    Last edited: Feb 10, 2021
  2. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    edited to make more sense ^
     
  3. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,142
  4. Blinxel_AR

    Blinxel_AR

    Joined:
    Jan 26, 2015
    Posts:
    67
    Thanks so much @KirillKuzyk . It really appears from a cursory read that this is indeed the problem. We'll investigate more deeply tomorrow.