Search Unity

ARFoundation point cloud manager tracking for the UI Manager?

Discussion in 'AR/VR (XR) Discussion' started by violetforest, Oct 9, 2019.

  1. violetforest

    violetforest

    Joined:
    May 26, 2015
    Posts:
    10
    I want to be able to say when a point cloud has been detected, update the UIManager to the "Tap to Place" Animation. Right now in UIManager.cs it returns a bool if Planemanager.trackables.count > 0, but when I try that for the ARPointCloudManager, it always returns true even if there are none detected in the scene. What conditions should I be using for the point cloud manager?

    Code (CSharp):
    1.     bool PlanesFound()
    2.     {
    3.         if (planeManager == null)
    4.             return false;
    5.  
    6.         return planeManager.trackables.count > 0;
    7.     }
    8.  
    9.     bool PointsFound()
    10.     {
    11.         if (pointsManager == null)
    12.             return false;
    13.  
    14.         return pointsManager.trackables.count > 0;
    15.     }
     
    Last edited: Oct 9, 2019