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 Tap to Place like Hologram 101 by Mixed Reality tool kit
Hello, I am super beginner about Hololens.
I did Academy - Hologram 101.
I want to add a Tap to Place function to my original model like Hologram 101 - Spacial Mapping.
I am confusing that Tap to Place function by Hologram 101 and Hologram 203 is different.
Additionally, both are not implemented by Mixed Reality toolkit - Unity.
I understood that I should use Mixed reality toolkit to develop my new app.
How can I use Mixed reality tool kit to do a "Tap to Place" ?
Is there any tutorials by using Mixed Reality toolkit??
Maybe it is too beginner question, but I am really confusing.
Best Answers
-
Optionsdbarrett ✭✭✭
TapToPlace is just a script inside of the MRTK. Attach it as a component to a Game Object in the scene and you will be able to tap and place it. To attach it as a component just import the MRTK and click Add Component and then search for TapToPlace and add it.
The MRTK is constantly being updated so the code is going to be different from the tutorial but, the same concept will apply.
AR Developer
5 -
Optionsdbarrett ✭✭✭
@nanaju on the GitHub repo each page has a readme document that talks about what all is inside of that particular folder. You just have to dig into and look around.
I believe it should stick to the spatial mesh by default. Make sure you have a spatial mapping prefab in your scene and make sure you have the Spatial Perception permission checked in the Player settings. I believe the
Allow Mesh Visualization
variable is the one responsible for attaching it to the Spatial Mesh.I set object's rotation by transform component, however, when I tap the object, it turns back to the default.
This is put in as a default in TapToPlace if you don't want to rotate the object around you would have to look in that script and comment out where it changes the object rotation to face the user.
AR Developer
5
Answers
TapToPlace is just a script inside of the MRTK. Attach it as a component to a Game Object in the scene and you will be able to tap and place it. To attach it as a component just import the MRTK and click Add Component and then search for TapToPlace and add it.
The MRTK is constantly being updated so the code is going to be different from the tutorial but, the same concept will apply.
AR Developer
@dbarrett I did it!! You are a super hero for me!
Then, How did you find the component? Is there any API documentation for MRTK ?
I can't find them.
And still, I have some problem.
This screenshot below is my current settings for the target gameobject.
I cannot understand how the settings will behave. Maybe some documents describing these settings...?
@nanaju on the GitHub repo each page has a readme document that talks about what all is inside of that particular folder. You just have to dig into and look around.
I believe it should stick to the spatial mesh by default. Make sure you have a spatial mapping prefab in your scene and make sure you have the Spatial Perception permission checked in the Player settings. I believe the
Allow Mesh Visualization
variable is the one responsible for attaching it to the Spatial Mesh.This is put in as a default in TapToPlace if you don't want to rotate the object around you would have to look in that script and comment out where it changes the object rotation to face the user.
AR Developer
@dbarrett Thank you so much! Your suggestions were perfect.
I could do everything!