unity-game-engineaugmented-realitywikitudeandroid-augmented-realitywikitude-sdk

How to track multiple objects in wikitude?


My use case is that I want to track different objects kept in different rooms. I uploaded the images of object(1) and downloaded the WTO file and successfully able to track it by setting the targetcollection property of object tracker. Now for the object(2) how should I proceed? I tried having two objecttrackers in my single scene and setting the targetcollection property to different WTO files, but it is not working.


Solution

  • If you don't need to track multiple targets at the same time, you can use a single ObjectTracker with a single WTO file that contains two targets.

    In the Target Manager, you can add the second object to an existing project, resulting in a WTO file with two targets.

    In Unity, the ObjectTrackable has OnObjectRecognized and OnObjectLost events, which will allow you to distinguish between which target is currently tracked, so you can enable / disable augmentations as necessary.