Hey everyone, I've created a blank project, importing the HolotoolKit-Unity, created a blank scene, and followed these instructions to the T https://developer.microsoft.com/en-...istence_in_unity#getting_the_worldanchorstore Problem is, my Async call NEVER finishes. If i put a debug statement in AnchorStoreReady() it never gets called at all. What is going on? I've used World Anchors before and never had this issue (prior versions of HTK). Am i missing something in the build settings or something? Literally empty project, with nothing in it Code (CSharp): using UnityEngine; using System.Collections; using UnityEngine.VR.WSA.Persistence; using UnityEngine.VR.WSA; public class CollaborationObjectManager : MonoBehaviour { private bool Placing; public string ObjectAnchorStoreName = "test"; /// <summary> /// Keeps track of locally stored anchors. /// </summary> WorldAnchorStore anchorStore = null; void AnchorStoreReady(WorldAnchorStore store) { Debug.Log ("NEVER GETS CALLED"); anchorStore = store; Placing = true; Debug.Log("looking for " + ObjectAnchorStoreName); string[] ids = anchorStore.GetAllIds(); for (int index = 0; index < ids.Length; index++) { Debug.Log(ids[index]); if (ids[index] == ObjectAnchorStoreName) { WorldAnchor wa = anchorStore.Load(ids[index], gameObject); Placing = false; break; } } } // Use this for initialization void Start () { WorldAnchorStore.GetAsync(AnchorStoreReady); } // Update is called once per frame void Update () { } }
Hello, You can try renaming the anchorStore to 'store' and then in the AnchorStoreReady function use this.store = store. Maybe that might work for you. When looking at the link above that is the one thing different with this script compared to the examples. Thank you, Wesley
Are you actually pushing this to a device? If you're in the Editor/Emulator .GetAsyc will never get called.
Yeah Hodgson, that was the issue. I was trying to test it in unity before ever pushing it to the device. Thanks!