Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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:
    26
    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:
    138
    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