Search Unity

ARFoundation referencePointsChanged not seeing 'update' event.

Discussion in 'AR' started by RegisVe, Nov 28, 2019.

  1. RegisVe

    RegisVe

    Joined:
    Mar 2, 2018
    Posts:
    34
    Hi, I'm subscribing to the referencePointsChanged event in the ARReferencePointManager. Basically I took the ReferencePoint example from ARFoundation example package and created a new script to see how point tracking works. I'm building for iOS using ARFoundation 3.0.

    Skipping the 'using' lines in the code below

    Code (CSharp):
    1. public class ARReferencePointInfo : MonoBehaviour
    2. {
    3.     ARReferencePointManager m_referencePointManager;
    4.  
    5.     void Awake()
    6.     {
    7.         m_referencePointManager = GetComponent<ARReferencePointManager>();  
    8.     }
    9.  
    10.     void OnEnable()
    11.     {
    12.         m_referencePointManager.referencePointsChanged += OnReferencePointsChanged;
    13.     }
    14.  
    15.     void OnDisable()
    16.     {
    17.         m_referencePointManager.referencePointsChanged -= OnReferencePointsChanged;
    18.     }
    19.  
    20.     void OnReferencePointsChanged(ARReferencePointsChangedEventArgs eventArgs)
    21.     {
    22.         Debug.Log("---");
    23.         Debug.Log(eventArgs);
    24.  
    25.         foreach (var referencePoint in eventArgs.added)
    26.         {
    27.             Debug.Log(referencePoint.trackingState);
    28.         }
    29.  
    30.         foreach (var referencePoint in eventArgs.updated)
    31.         {
    32.             Debug.Log(referencePoint.trackingState);
    33.         }
    34.  
    35.         foreach (var referencePoint in eventArgs.removed)
    36.         {
    37.             Debug.Log(referencePoint.trackingState);
    38.         }
    39.         Debug.Log("---");
    40.     }
    41. }
    Unfortunately I'm not seeing the debug log 'eventArgs.updated'. Only log events for points added and removed are shown.

    With similar code in imageTracking I get update events back every frame. But no update events are shown in this example