Log in or register to post comments

onNewSearch result error

March 24, 2019 - 9:07pm #1

I`m building an app using cloud recognition to play an URL video.

Console gives me these two errors, I think it`s an error with the new update. can someone please help.

 

Unsupported TargetFinder type provided

UnityEngine.Debug:LogError(Object)

Vuforia.ObjectTracker:GetTargetFinder()

SimpleCloudHandler:OnNewSearchResult(TargetSearchResult) (at Assets/SimpleCloudHandler.cs:49)

Vuforia.ObjectRecoBehaviour:Update()

 

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

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

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

 

*****this is my OnNewSearchResult,

 

public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)

    {

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

        Debug.Log("CloudReco: new search result available: " + targetSearchResult.TargetName);

        GameObject newImageTarget = Instantiate(behaviour.gameObject) as GameObject;

        MainPlayer = newImageTarget.transform.GetChild(0).gameObject;

        GameObject augmentation = null;

        if (augmentation != null)

        {

            augmentation.transform.SetParent(newImageTarget.transform);

        }

        if (behaviour)

        {

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

            ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder<TargetFinder>().EnableTracking(targetSearchResult, newImageTarget);

        }

        string URL = cloudRecoSearchResult.MetaData;

        MainPlayer.GetComponent<VideoPlayer>().url = URL.Trim();

        cloud.CloudRecoEnabled = true;

    }

onNewSearch result error

April 19, 2019 - 3:23am #2

Ive got similar problem. The error I get when image is found is:

Unity: NullReferenceException: A null value was found where an object instance was required.

      at SimpleCloudHandler.OnNewSearchResult (Vuforia.TargetSearchResult targetSearchResult)

Log in or register to post comments