Search Unity

Runtime created imageTargets recreated after load new scene.

Discussion in 'Vuforia' started by dred, Jan 10, 2019.

  1. dred

    dred

    Joined:
    Apr 8, 2013
    Posts:
    30
    Hello,

    I have some trouble with understanding how work TrackerManager.Instance.GetStateManager().ReassociateTrackables();

    The description say's that removes destroyed trackables from lias and add newly created. I add this line to my DefaultTrackableEventHandler. From main scene, where I create some targets from runtime through DataSet.Load(). Then I load new scene with 1 predefined trackingImage, and also get all from previous scene. How I can prevent this?
     
  2. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    DataSet.Load() will create empty trackable objects in the scene if none have been predefined. Before loading a scene that does contain a predefined image from this dataset, the automatically created one needs to be destroyed.

    In the new scene, calling TrackerManager.Instance.GetStateManager().ReassociateTrackables(); from a Start() method should then configure everything correctly.

    An additional description for the ReassociateTrackables() is that it "can be used if there are two different augmentations for the same trackable in two different scenes".

    Hope this helps.

    Thanks,
    Vuforia Engine Support