Start a new topic

InstantTracking looking for missing file

The SDK 9.12 Pro for Unity does not include any samples, so I'm currently working with 9.10 Pro for Unity, however when trying the Instant Tracking - Load Instant Target scene, it ask for a missing file named InstantTarget.wto. I can see the script LoadInstantTarget.cs is executed once the LoadSceneButton is tapped, however is looking for files in a different destination than the project:

private void LoadTarget() {

        /* A TargetCollectionResource is needed to manage file loading. */

        var targetCollectionResource = new TargetCollectionResource();

        /* UseCustomURL is used to specify that the file is not inside the "StreamingAssets" folder */

        targetCollectionResource.UseCustomURL = true;

        /* The "file://" is used to indicate that the file is located on disk, and not on a server. */

        targetCollectionResource.TargetPath = "file://" + Application.persistentDataPath + "/InstantTarget.wto";

        var configuration = new InstantTargetRestorationConfiguration();

        configuration.ExpansionPolicy = InstantTargetExpansionPolicy.Allow;

        Tracker.LoadInstantTarget(targetCollectionResource, configuration, LoadSuccessHandler, LoadErrorHandler);

    }


    /* Loads all augmentations from disk. */

    private void LoadScene() {

        try {

            string json = File.ReadAllText(Application.persistentDataPath + "/InstantScene.json");

            var sceneDescription = JsonUtility.FromJson<SceneDescription>(json);


            foreach (var augmentation in sceneDescription.Augmentations) {

                Controller.LoadAugmentation(augmentation);

            }

        } catch (Exception ex) {

            InfoMessage.text = "Error loading scene augmentations.";

            Debug.LogError("Error loading augmentations: " + ex.Message);

        }

    }

Even if I manage to add the firetruck.wto file on that location and rename it to InstantTarget.wto, I still get the error:

"Error loading augmentations"


I there something that I'm missing here? I was not able to find an updated tutorial or steps on how to execute the sample properly.

1 Comment

 Hi Jean,


so far you did everything right in importing our SDK samples. You're getting this error because in order to load an instant target in the Load Instant Target scene you first have to save a target in the Save Instant Target scene. Once that's done you should be good to go.


We are sorry for the inconveniences of having to use a previous SK version in order to get the samples. We had to temporary disable them in our current release. But they will be back in our next release version 9.13 which will be released soon. So stay tuned! :)


With best regards,

Peter

Login or Signup to post a comment