Create Image Targets dynamically | Vuforia Developer Portal

Hey I’m using Vuforia in combination with Unity for my bachelorproject.
I am trying to create Image Targets dynamically by code. So created a local database, downloaded and imported in my project.
I can create Image Targets per hand but I want them to be generated by code.
 
 
With this line I’m creating the targets. And it’s the same like in the official tutorial by vuforia
library.vuforia.com/unity-extension/create-and-load-targets-unity
foreach (var target in targetNames)
            {
                var itBehaviour =
                    VuforiaBehaviour.Instance.ObserverFactory.CreateImageTarget(vuforiaDatabase, target);
                itBehaviour.OnTargetStatusChanged += OnTargetStatusChanged;
 
My problem is, I am getting the following message:
Exception in callback: Failed to create ImageTargetObserver: DATABASE_LOAD_ERROR.
UnityEngine.Debug:LogErrorFormat (string,object[])
Vuforia.Internal.Utility.UnityLogger:LogError (string,object[])
Vuforia.Internal.Utility.Log:Error (string,object[])
Vuforia.Utility.ExtensionMethods.DelegateHelper:InvokeDelegate (System.Delegate,object[])
Vuforia.Utility.ExtensionMethods.DelegateHelper:InvokeWithExceptionHandling<Vuforia.VuforiaInitError> (System.Action`1<Vuforia.VuforiaInitError>,Vuforia.VuforiaInitError)
Vuforia.VuforiaApplication:VuforiaInitialized (Vuforia.VuforiaInitError)
System.Delegate:DynamicInvoke (object[])
Vuforia.Utility.ExtensionMethods.DelegateHelper:InvokeDelegate (System.Delegate,object[])
Vuforia.Utility.ExtensionMethods.DelegateHelper:InvokeWithExceptionHandling<Vuforia.VuforiaInitError> (System.Action`1<Vuforia.VuforiaInitError>,Vuforia.VuforiaInitError)
Vuforia.Internal.Core.Engine:InitOnCameraReady ()
Vuforia.WebCam:HandleFirstWebCamFrame ()
Vuforia.WebCam:<Init>b__33_0 (bool)
Vuforia.Internal.Utility.VuforiaCoroutineUtility/<RunCoroutineWithTimeout>d__1:MoveNext ()
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Does anyone have any idea what the problem could be?
Thx for your help 🙂
 
 

Read more here: Source link