List
Unity Addressable and Instant Tracker. loading resources from server
Posted Date: 2020-07-30 14:28     Edited Date: 2020-08-07 3:23     Writer: inactive

Development details:

1. SDK Version: 5.0.2
2. Development Environment: (eg. Unity-Android, Unity-iOS, Native Android, Native iOS): Unity-Android
3. Tracker/Scanner: Instant tracker
4. License Type(Free / Pro-One Time Fee / Pro-Subscription / Enterprise): Free
5. Target Device(Optional): Any

Hi,

I want to load resources from a server and use it in the instant tracker. I have tried two ways but still, I can't get the AR behavior.

1st way:

Here I have created an InstantTrackableBehaviour public variable (prefab in the below code) and dragged an instantTrackable prefab from unity inspector window. Then when a button press I loaded my 3D object from server and attach it as a child to instant trackable and instantiate it like below code.

var locations = await Addressables.LoadResourceLocationsAsync(label).Task;

        foreach (var location in locations)
        {

InstantTrackableBehaviour instantTrackable = InstantTrackableBehaviour.Instantiate(prefab) as InstantTrackableBehaviour;
GameObject obj = await Addressables.LoadAssetAsync<GameObject>(location).Task;

obj.transform.parent = instantTrackable.transform;
Instantiate(obj);
instantTrackable.OnTrackFail();
}

 

Here the object is loading but it doesn't have AR behaviour. just moving with the mobile screen.

2nd way:

Here I created an addressable from InstantTrackable prefab that has attached a child 3d object. Then I'm tried to load it from server and instantiate.

var locations = await Addressables.LoadResourceLocationsAsync(label).Task;

        foreach (var location in locations)
        {

InstantTrackableBehaviour instantTrackable = await Addressables.LoadAssetAsync<InstantTrackableBehaviour>(location).Task;
InstantTrackableBehaviour instantTrackable2=InstantTrackableBehaviour.Instantiate(instantTrackable) as InstantTrackableBehaviour;
instantTrackable2.OnTrackFail();

}

 

This led me to the below exception.

 Exception encountered in operation Resource<InstantTrackableBehaviour>(InstantTrackable (1).prefab): Unknown error in AsyncOperation

 

How can I load resources from a server and use it in the instant tracker?

Thank You!

Posted Date: 2020-08-04 4:15     Edited Date: 2020-08-04 4:15     Writer: sjkim

We wanna some qustion for fixed issue.

 

Are you trying to process the Instant Tracker through the server?

Does the existing sample code work properly on your mobile device?

 

If you have other questions, feel free to questions us.

 

 

Best regards

Francisco

MAXST Support Team

Posted Date: 2020-08-04 4:34     Edited Date: 2020-08-04 4:34     Writer: inactive

Yes. I want to load only the 3d object from the server.

Yes. Existing sample code work properly.

Posted Date: 2020-08-05 7:50     Edited Date: 2020-08-05 7:50     Writer: inactive

Hi,

Is there any solution for me?

Posted Date: 2020-08-07 0:56     Edited Date: 2020-08-07 0:56     Writer: sjkim

Sorry to late reply.

 

Unfortunatly, We don't support related server.

Because, The forum only responds to MAXST AR SDK related usage and bug fixes.

 

If you have other questions, feel free to questions us.

 

 

Best regards

Francisco

MAXST Support Team

Posted Date: 2020-08-07 3:23     Edited Date: 2020-08-07 3:23     Writer: inactive

No, It's related to the SDK. Not about an addressable issue. So I can't post in unity forum. Normal objects work with my code.When render an Instant trackerble it missing AR behaviour. Just act like normal object. 

 

Is there any way to loading from server(with or without addressables). Because we are going to use lot of objects. So can't put all of them inside the app. For now we are testing the SDK and if it match with our all requirements we hope to buy licenced SDK.

Is there any method you used to render instant trackables that loaded from a server?

Thank you.