Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jchandr's avatar
jchandr
Explorer
1 year ago

Loading unbound anchors returns [0 or anchors_count_till_last_session] (NOT null)

I saved the anchors' uuid in the playerprefs after creating them - it's getting created successfully.

Then, I tried to load the anchors in the same session without quitting the app (my use case is to visually clear the anchors after saving and loading them on the user's command) - the resultant anchors-array from LoadingUnboundAnchors is NOT null but it contains only anchors from last session.

Once I quit and reopen the app, the anchors are loading successfully.

I want to load them before quitting the app as well (I mean in the same session). Any ideas on why this is not happening?? Or any suggestions on how to implement this?

 

OVRSpatialAnchor.LoadUnboundAnchorsAsync(loadOptions).ContinueWith(anchors =>
{
	if(anchors == null)
	{
		Debug.Log("Anchor Sample: Load anchors failed with null result.");
	}
	Debug.Log($"Anchor Sample: anchors available {anchors.Length}"); //length is zero if loaded in the same session or it is equal to the number of anchors created till the last session
});

 

 

Replies have been turned off for this discussion