Start a new topic

Multiple Objects Trackers

I'm trying to have multiple object trackers the same way as multiple image trackers example.

I'm switching from one tracker to another when clicking on a button but the tracker does not switch and stay on the same 3D object.



 

public GameObject figureInstructions;
public GameObject teaInstructions;

public ObjectTracker figureTracker;
public ObjectTracker teaTracker;

private bool _waitingForTrackerToLoad = false;

 public void OnFigureTracker()
    {
        if(!figureTracker.enabled && !_waitingForTrackerToLoad)
        {
            _waitingForTrackerToLoad = true;
            teaInstructions.SetActive(false);
            figureInstructions.SetActive(true);

            figureTracker.enabled = true;
            teaTracker.enabled = false;
        }
    }

    public void OnTeaTracker()
    {
        if (!teaTracker.enabled && !_waitingForTrackerToLoad)
        {
            _waitingForTrackerToLoad = true;
            figureInstructions.SetActive(false);
            teaInstructions.SetActive(true);

            teaTracker.enabled = true;
            figureTracker.enabled = false;
        }
    }

    public override void OnTargetsLoaded()
    {
        _waitingForTrackerToLoad = false;
        Debug.Log("OnTargetsLoaded " + _waitingForTrackerToLoad);
    }

 What am I doing wrong ?

Thank you.

 

 

 

 

 


Hello Cedric,

It is not possible to track multiple objects at the same time, so you need to implement them like the Different Targets sample. It is possible to have one .wto file with multiple objects, it is just that you cannot recognize them at the same time and this is why you need to implement it with the sample I suggested.

Thanks
Eva

 

Hi, how can i switch between trackers?

Hi Katrina,


You need to create two trackers with different WTO files assigned to each one and toggle between the trackers. For more information, also refer to the forum post here https://support.wikitude.com/support/discussions/topics/5000087088. It works the same as with a .wtc file.


Thanks

Eva

Is there a way for multiple objects to be recognized by Wikitude (e.g. event triggers, without users clicking on a button)? 

Login or Signup to post a comment