Log in or register to post comments

Error on CreateDataSet()

March 7, 2017 - 7:31am #1

Hello I'm trying this code and it throws an error:

 

Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object

 

The line that breaks is:

 

DataSet dataSet = objectTracker.CreateDataSet();

 

Here is the entire code:

 

using UnityEngine;
using System.Collections;

using Vuforia;
using System.Collections.Generic;


public class DynamicDataSetLoader : MonoBehaviour
{
    void Start()
    {
        VuforiaARController.Instance.RegisterVuforiaStartedCallback(LoadDataSet);
    }

    void LoadDataSet()
    {

        ObjectTracker objectTracker = TrackerManager.Instance.GetTracker();
        DataSet dataSet = objectTracker.CreateDataSet();
    }
}

I saw many people that have this problem and none of them got solution.

Error on CreateDataSet()

March 9, 2017 - 3:35am #3

Yes, if you read the code it's the same thing. It breaks because TrackerManager.Instance.GetTracker<objecttracker>() is null.

Error on CreateDataSet()

March 8, 2017 - 4:13pm #2

Hello,

Have you reviewed this? https://developer.vuforia.com/forum/faq/unity-load-dataset-setup-trackables-runtime

Thanks.

Log in or register to post comments