Search code examples
unity-game-enginevuforia

Does Vuforia Has an Event flag when Surface is Detected?


i want to run a script of Loading 3d models at runtime only when surface is recognized , how can i do it in Vuforia?


Solution

  • Vuforia performs Automatic hit tests to detect ground using PlaneFinderBehaviour so you can check the result of this test and if it is some thing other than null it means ground is detected. You can do it by creating a method like this one:

    public void Test(HitTestResult result)
    {
        if(result !=null)
           Debug.Log(result);
    }
    

    Then you can register this function to your Plane Finder Behaviour like this:

    enter image description here

    In conclusion you can change the logic of course but main idea is to check if Automatic hit test returns a value. Good luck!