question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

World Anchor Store never ready

See original GitHub issue

I stumbled upon this problem yesterday, when i first got into world anchors. Basically what i tried is to get the World Anchor Manager working, but the problem i had is that the callback when the anchor store is ready never got called. So i thought maybe i just messed up and created a new project with just the spatialmapping and world anchor store manager in it. Well the end of the story was that it still didnt work.

So i fiddled around a little bit and changed:

protected override void Awake()
        {
            base.Awake();

            AnchorStore = null;
            WorldAnchorStore.GetAsync(AnchorStoreReady);
        }

to

void Start()
        {
            AnchorStore = null;
            WorldAnchorStore.GetAsync(AnchorStoreReady);
        }

Basically i let the code in the Awake() function run in the Start() function. Maybe there is something not yet initialized when Awake() gets called, cause i also got an NullReference Error.

Is this a bug? Should the code in Awake() run in the Start() function?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
StephenHodgsoncommented, May 30, 2017
2reactions
lucaheftcommented, May 30, 2017

If you have problems or questions please post them here HoloLens Forum.

Try this:

void Start()
{
    WorldAnchorStore.GetAsync(myAsyncDelegate);
}

public void myAsyncDelegate(WorldAnchorStore store){
    this.store = store;
    text.text = store.anchorCount.ToString();
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

World Anchor Store never ready · Issue #640
I stumbled upon this problem yesterday, when i first got into world anchors. Basically what i tried is to get the World Anchor...
Read more >
Problems with the WorldAnchorStore - Forums
Hello guys, i'm currently working with the Mixed Reality Toolkit and the HoloLens and apparently the Toolkit uses the WorldAnchorStore class ...
Read more >
World locking and spatial anchors in Unity - Mixed Reality
World Locking Tools automatically handles internal creation and management of spatial anchors. You don't need to interact with ARAnchorManager ...
Read more >
How to use unity world anchors?
Putting the code on and item "WorldAnchor anchor = gameObject.AddComponent();" while syntactically correct, doesn't do anything. I can't find ...
Read more >
WorldAnchorStore - Scripting API
The storage object for persisted WorldAnchors. Variables. anchorCount, (Read Only) Gets the number of persisted world anchors in this WorldAnchorStore.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found