Log in or register to post comments

Vuforia 6.2 2 Trackable 1 Image Target & ImageTargetBehavior get destroyed

June 1, 2017 - 6:30pm #1

Hello, I am asking for help. I am creating a Vuforia project where I have two scene (Main where I put Video & Next where I put 3D model) and each of them have the same image target. I tried DontDestroyOnLoad for the ARCamera since I don't know where the KeepARCameraAlive behavior is in Unity 5.6.1. I once read that you need to put TrackerManager.Instance.GetStateManager().ReassociateTrackables(); into DefaultTrackableEventHandler. However I am using TrackableEventHandler (for Video) so I don't know where to put it in the script.

 

Then I get an error the ImageTargetBehavior get destroyed in Next Scene and I should check if it should be null or not. Any input is appreciated. Thank you. Here is the error;

Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.MissingReferenceException: The object of type 'ImageTargetBehaviour' has been destroyed but you are still trying to access it.

Your script should either check if it is null or you should not destroy the object.

  at (wrapper managed-to-native) UnityEngine.Behaviour:get_enabled ()

  at Vuforia.StateManagerImpl.RemoveDisabledTrackablesFromQueue (System.Collections.Generic.LinkedList`1& trackableIDs) [0x00000] in <filename unknown>:0

  at Vuforia.VuforiaManagerImpl.UpdateTrackers (FrameState frameState) [0x00000] in <filename unknown>:0

  at Vuforia.VuforiaManagerImpl.Update (ScreenOrientation counterRotation, Boolean reapplyOldState) [0x00000] in <filename unknown>:0

  at Vuforia.VuforiaARController.UpdateStatePrivate (Boolean forceUpdate, Boolean reapplyOldState) [0x00000] in <filename unknown>:0

  at Vuforia.VuforiaARController.UpdateState (Boolean forceUpdate, Boolean reapplyOldState) [0x00000] in <filename unknown>:0

  at Vuforia.DigitalEyewearARController.Update () [0x00000] in <filename unknown>:0

  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)

  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

  --- End of inner exception stack trace ---

  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232

  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115

  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000b9] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:443

  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/MulticastDelegate.cs:71

  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Delegate.cs:415

  at Vuforia.DelegateHelper.InvokeDelegate (System.Delegate action, System.Object[] args) [0x00000] in <filename unknown>:0

UnityEngine.Debug:LogError(Object)

Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])

Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)

Vuforia.VuforiaAbstractBehaviour:Update()

 

 

Log in or register to post comments