Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  4. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Resolved Disable and re-enable image tracking ARKit

Discussion in 'AR' started by saifshk17, Jan 22, 2021.

  1. saifshk17


    Dec 4, 2016
    Is there a way to disable and re-enable tracking for images in ARKit? From the older version, this was the solution. But in the newer versions have removed UnityARSessionNativeInterface script.

    Code (CSharp):
    1.  void Start ()
    2.      {
    3.          m_session = UnityARSessionNativeInterface.GetARSessionNativeInterface();
    4.      }
    5. void AddImageAnchor(ARImageAnchor arImageAnchor)
    6.      {
    7.              //at the bottom of this function
    8.              StartCoroutine(RemoveAnchorCoroutine(arImageAnchor));
    10.      }
    11.     IEnumerator RemoveAnchorCoroutine(ARImageAnchor anchor)
    12.      {
    13.          yield return new WaitForSeconds(3.0f);
    14.         //doesn't have to be in a coroutine, but for my uses it is
    15.          m_session.RemoveUserAnchor(anchor.identifier);
    16.      }
  2. TreyK-47


    Unity Technologies

    Oct 22, 2019
    UnityARKitPlugin has been deprecated and is no longer supported.
    saifshk17 likes this.