Start a new topic

how to properly pass recognizedTarget to a callback

How do I properly pass along the ImageTarget recognizedTarget to a callback within the events section in Unity's inspector? 


1. I'm not sure if the object near TargetAcquired is supposed to be the ImageTrackable object, as well, I'm not sure how to access the recognizedTarget. When I run this and debug through Xcode's console I don't see any message about being in the TargetAcquired method.

1 Comment


Instead assigning the Trackable, you should assign the GameObject that contains the C# script, and make sure that the script implements a method that accepts a Wikitude.ImageTarget as a parameter.

using Wikitude;


    public void OnImageRecognized(ImageTarget target) { ... }

    public void OnImageLost(ImageTarget target) { ... }


Then, instead of selecting GameObject.BroadcastMessage, you can select OnImageRecognized from the dropdown, under the category that matches your script name. Please make sure to select the OnImageRecognized from the top of the list, under the title "Dynamic ImageTarget". You can then do the same for OnImageLost.

As an example, please take a look at the "Image Tracking - Multiple Targets" sample scene , where the Trackables are set this way.

Additionally, you can have a look at our documentation regarding Image Tracking, which also talks about setting up the events

Best regards,


Login or Signup to post a comment