Log in or register to post comments

Cloud target

June 16, 2019 - 3:03am #1

I`m working on cloud recognition project

and the unity console gives me this error can someone please help

NullReferenceException: Object reference not set to an instance of an object

SimpleCloudHandler.OnNewSearchResult (Vuforia.TargetFinder+TargetSearchResult targetSearchResult) (at Assets/SimpleCloudHandler.cs:75)

Vuforia.ObjectRecoBehaviour.Update () (at <fd74d8cbd16c41dfa7613efef6dc1b01>:0)

 

This is my code used:

 

public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)

    {

        TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult;

        // ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.TargetFinder.EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject);

        //do something with the target metadeta

        mTargetMetadata = cloudRecoSearchResult.MetaData;

        //stop the target finder (i.e. stop scanning the cloud)

        mCloudRecoBehaviour.CloudRecoEnabled = false;

        // Build augmentation based on target

        if (this.ImageTargetTemplate)

        {

            // enable the new result with the same ImageTargetBehaviour:

            ObjectTracker tracker = TrackerManager.Instance.GetTracker<ObjectTracker>();

            ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder<TargetFinder>().EnableTracking(targetSearchResult, this.ImageTargetTemplate.gameObject);

        }

    }

Log in or register to post comments