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.

how to use TapToPlace?

Hi,
I am trying to make a simple cube which I can put on a surface, I added a Camera, Spatial Mapping and a test cube to the unity. I am using the latest holo tool kit from github, I added taptoclick to my cube, however this doesnt work as AnchorManager is null and so it destroys itself. Am i missing something?

Thanks a lot
// Make sure we have all the components in the scene we need.
anchorManager = WorldAnchorManager.Instance;
if (anchorManager == null)
{
Debug.LogError("This script expects that you have a WorldAnchorManager component in your scene.");
}

Answers

  • Hi Kmukul,

    Add a WorldAnchorManager script to your project. It's in HoloToolkit\Utilities\Scripts and you can add it to your Camera or else create an empty game object called Managers and hang it on there. That should get you past this error.

    James

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

  • TapToPlace uses the WorldAnchorManager to load/store and stabalize hologram positions for objects that have been placed by the user. You should create a new GameObject in your scene and add the WorldAnchorManager script to it, that will initialize the singleton instance so that the TapToPlaceScript can use it.

  • Besides adding WorldAnchorManager which was already mentioned, You also need to add the cursor prefab which itself requires the GazeManager and GestureManager.

  • Thanks everyone for your help,
    I hadded a worldanchormanager to the cube itself, that did not seem to work? How does it determine the order in which to instantiate these objects? I

  • @kmukul,

    Instantiation is supposed to be non-deterministic. All the same, try placing it on your camera or on an empty GameObject and see if that works better.

    James Ashley
    VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
    Microsoft MVP, Freelance HoloLens/MR Developer
    www.imaginativeuniversal.com

Sign In or Register to comment.