Open LocalJoost opened 2 years ago
Nice to see this process in action, but also I am sort of glad that is not what I do (any more), even though something still "tickles" reading this. Just keep doing what you're doing. đđť
What I did actually was just track the Select Exited event in the XR Ray Interactors on each of the hand rigs to track if an air tap was done for one of my projects
There are obviously more ways to Rome đ
Thanks, this was super helpful in getting a "tap to place" behavior working again
You're welcome, but most thanks should go to Finn đ
How do I get position(x y z) when I click in air? include hand ray position and no hand ray position
look like MRTK2:
public void OnPointerClicked(MixedRealityPointerEventData eventData) { // čˇĺĺ˝ĺć´ťĺ¨ćéçĺ˝ä¸çťć var result = eventData.Pointer.Result;
// ćŁćĽĺ˝ä¸çťććŻĺŚćć
if (result != null)
{
// čˇĺĺ˝ä¸çšçä˝ç˝Ž
var hitPosition = result.Details.Point;
Debug.Log("Air tap position: " + hitPosition);
}
}
Hello! Thanks so much for your posts, I find them very helpful! I tried your air tap approach which works fine in the Unity editor using the MRTKInputSimulator, but it does not work when deployed to Hololens 2. Hand tracking is enabled and working because I can add an ObjectManipulator to an object and I can interact with it. However, your air tap detection approach is not working. Any suggestions about why this is happening?
@armengol it very much works in HoloLens, that's what I use in HoloATC and various demo applications. Being unfortunately nor telepathic nor clairvoyant, I have no idea what is happening. I can only read code. I suggest downloading a sample and then trying to deploy that.
Cool, I'll try the sample. Thanks for your reply!
@LocalJoost I could not open the sample project in my Unity Editor version, a lot of broken stuff...
I reproduced the DirectInputAirTapDisplayer
script in my project (using also MRTK LeftHand/Select Value
and so on) and as mentioned it works fine in the Editor. I even have a little debugging object to display the Value of the Air Tap gesture. However when deployed in Hololens the subscribed methods ( ProcessLeftHand
, ProcessRightHand
) are never triggered with the Air Tap event. It is confusing because the gesture is recognized since there is a response in the hand ray interactor, for example. I know this doesn't tell you much about my problem, but I wonder if there may be a specific detail I'm missing for it to work in the Hololens...
https://github.com/LocalJoost/BlogComments/assets/13226134/85f27ce2-ec56-4da6-a112-3f44f5608674
@armengol "could not open the sample project in my Unity Editor version, a lot of broken stuff..." Please show me what is going wrong when you open the project in a Unity editor. Please use the same version as I used myself in the demo project.
@LocalJoost I downloaded the same Unity Editor version as in your demo project:
@armengol I see. Yeah, this happens sometimes with older samples. Unfortunately the RealityCollective folks have messed up the very first part of their openupm feed. As you can here here preview-2 does not exist anymore. I updated the branch using_inputreference to 1.0.0. This is not the latest version, but it should make this demo work again. I never got this error here, because Unity keeps a package cache locally. Meh. However, when I cleaned both the openupm cache and the project's cache, it works. Good luck. Be aware the project is a bit old, uses pre-releases versions of the MRTK3 and not the latest version of the RealityCollective stuff. You might also have a look at a newer branch, like this one https://github.com/LocalJoost/MRKTAirTap/tree/crossplatairtap-rayendposition which is based upon newer versions.
Great, thanks for your help!
Original article: https://localjoost.github.io/MRTK2-to-MRTK3-a-MUCH-SIMPLER-way-to-intercept-a-raw-air-tap-like-with-IMixedRealityPointerHandler/