Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

world anchor delete

Hi,i find world anchor can solve change scene position in same location.But i find a problem,when i open app,the location always same,this mean RemoveAllAnchors() don't work

Best Answer

  • Options
    Answer ✓

    @dbarrett ,thank you tell me move the object to a "default position" after remove anchor is called.I modify my code,but it also not working.I have three scenes,i want take them in same position,so fist scene i want delete old world anchor and set object position 2 meter far away with camera,and build new world anchor and save it, left scenes just load it.

Answers

  • Options

    No, it is because you put it inside of an if statement that looks like it will always be false. Even though your anchors persist, your variables do not unless you make them player prefs.

    AR Developer

  • Options

    @dbarrett Thank you for reply,there is a flag buildposition,i set it true for first scene.That mean when i open app,and show the first scene,the deleteAnchor is working.But it don't happen.

  • Options

    Okay so how do you know it isn't working? because you are calling it in the start method the position isn't going to change from where it was previously to a new position. It will still be relatively in the same spot where it was before. You need to create another method to move the object to a "default position" after remove anchor is called.

    You are also attaching a new anchor right after you removed all anchors.

    AR Developer

  • Options

    Also you should try and limit the number of anchors you have in your scene as it is also very resource heavy. The best practice is to have one object as the anchor and have a bunch of children under it. This remains true of course as long as you are in the same room (i.e. 5 meter radius or so). If your objects are farther apart than that then you would need to create another anchor, etc.

    AR Developer

  • Options
    Answer ✓

    @dbarrett ,thank you tell me move the object to a "default position" after remove anchor is called.I modify my code,but it also not working.I have three scenes,i want take them in same position,so fist scene i want delete old world anchor and set object position 2 meter far away with camera,and build new world anchor and save it, left scenes just load it.

  • Options

    Alright, find your WorldAnchorManager in the hierarchy and make sure you have Persistent Anchors checked and also check the Show Detailed Logs Boolean. Run your program again and check the debug this time and see what it is saying.

    AR Developer

  • Options

    @dbarrett I reinstall the app without change code,that is working.

Sign In or Register to comment.