MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Recreating Tap to place in MRTK 2

Open migueltiago opened this issue 7 years ago • 4 comments

Hello every one, I'm trying to recreate the TapToPlace interaction with the objects using Surface Magnetism, but I need to apply Ignore Raycast to the object so the object don't "snap" with the main camera, but after that I can't interact with object.

Was someone able to recreate the same interaction with this new version?

migueltiago avatar May 09 '19 10:05 migueltiago

@cre8ivepark I think that you've got the most solvers expertise on the team. Can you help out with this one? If there's more information required here please let us know.

wiwei avatar May 15 '19 00:05 wiwei

@migueltiago and @wiwei, I figured out a decent work around until the "Tap To Place" script is available. I used the "Interactable" script and the "Orbital" solver components.

I then did a little bit of configuring to make it work how I want it to:

I set up the interactable component to be a toggle button by changing the dimensions to equal 2. I then selected the "InteractableOnToggleReceiver" Event Type. Then I created a script that has two methods, one that turns on the solver and one that turns off the solver. (This is pretty easy, just get a reference to the "SolverHandler" and then change the boolean "UpdateSolvers" to true or false.) On the "OnSelect()", I have it set up to call the method that turns on the solver. On the "On Deselect()", I have it set up to call the method that turns off the solver.

Since your wanting to use the magnetism solver, you might need to change this a little bit to make it work for what you are wanting.

DrewLovejoy avatar May 24 '19 12:05 DrewLovejoy

How do you set it up? After selecting (=deselect), the object goes back to the origin?

mariahaber01 avatar Jul 27 '19 15:07 mariahaber01

Dupe of #4515

Troy-Ferrell avatar Oct 24 '19 22:10 Troy-Ferrell