Log in or register to post comments

Delete Image Target Behaviour on Unity

October 6, 2014 - 6:05pm #1
I have a `GameObject` that has a script called `AristaImageTarget` which implements the `ITrackableEventHandler` interface and contains a reference to an `ImageTargetBehaviour` which is a child of it. The problem is that every time I delete `AristaImageTarget` I get this error
 
    MissingReferenceException: The object of type 'ImageTargetBehaviour' has been destroyed but you are still trying to access it.
 
and the culprid seems to be the `ARCamera` according the console when I click on the error. So I decided to do this on `OnDestroy` on `AristaImageTarget`
 
    trackable.UnregisterTrackableEventHandler (this);
    Destroy (trackable);
 
Where `trackable` is the reference to the `ImageTargetBehaviour`. But I still get the error :(
 

Delete Image Target Behaviour on Unity

October 13, 2014 - 7:42pm #2

If you instantiate the ImageTarget and assign the DataSet programmatically in Unity PlayMode, do you see a value set in the ImageTarget field for that DataSet? You can view this in the Inspector Settings for the instantiated ImageTarget.

Log in or register to post comments