microsoft / MixedReality250

Open source project from the //build2017 Mixed Reality Academy
Other
43 stars 24 forks source link

Clients does not obtain Anchor from server with multiple hololenses.. #20

Open SorenMuller opened 6 years ago

SorenMuller commented 6 years ago

Hi,

I'm trying to get your demo to work with multiple holo lenses.

The hololens acting as server works fine. But when I try to join that, I get an nullreference exeption at the HERE location, since AnchorStore is null.. This results in no shared anchor...

Hope someone can help..

UNetAnchorManager.cs :

private bool AttachToCachedAnchor(string CachedAnchorName)
{
           if (string.IsNullOrEmpty(CachedAnchorName))
            {
                Debug.Log("Ignoring empty name");
                return false;
            }
#if UNITY_WSA
            UnityEngine.XR.WSA.Persistence.WorldAnchorStore anchorStore = WorldAnchorManager.Instance.AnchorStore;

            string[] ids = anchorStore.GetAllIds();   <== HERE

            for (int index = 0; index < ids.Length; index++)
            {
                if (ids[index] == CachedAnchorName)
                {
                    Debug.Log("Using what we have");
                    anchorStore.Load(ids[index], objectToAnchor);

Regards Søren Müller CadPeople A/S