Hello,
I have tried this https://developer.vuforia.com/forum/faq/unity-load-dataset-setup-trackables-runtime
and it gives me error. I saw many people that have this problem and none of them got solution.
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 ( the forum adds closing </objectracker> tag automatically ):
ObjectTracker objectTracker = TrackerManager.Instance.GetTracker();
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(); } }
Every time I return to vuforia development I do the same mistake. In our case the problem is that we have set webcam as the play mode device in vuforia configuration, and forgotten to plug in the webcam, that's why it works in a build but doesn't work in the editor :)