How to Implement Gaze, Grab, Move, and Release of a Virtual Object in Hololens 2 using Unity 2021.3 LTS and Visual Studio 2022?

Pei Yunqiang 5 Reputation points
2023-12-27T02:02:24.6033333+00:00

I’m developing an application for Hololens 2 using Unity 2021.3 LTS and Visual Studio 2022. I want to implement a feature where the user can gaze at a virtual object, select it by making a pinch gesture (thumb and index finger closing in air), move the object by moving their eyes or head (while keeping the pinch gesture), and finally place the object at a desired location by releasing the pinch gesture (thumb and index finger opening).

I’m having trouble figuring out how to implement this. I’ve tried using the MRTK toolkit but I’m not sure how to correctly use the gaze and gesture inputs to move the object. Any help or guidance would be greatly appreciated. Please let me know if you need more information about my setup or the specific problem I’m facing. Thank you!

HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
398 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ying Li - MSFT 1,200 Reputation points Microsoft Vendor
    2023-12-27T09:53:50.4033333+00:00

    Hello, Welcome to Microsoft Q&A,

    To implement your requirements, you need to use eye tracking. Please refer first to the following link: Eye Tracking Basic Setup - MRTK 2 | Microsoft Learn.

    You can use EyeTrackingTarget to implement your requirements for using eye gaze and hand gestures to move objects. For more details, please refer to this example - Eye tracking examples overview - MRTK 2 | Microsoft Learn. To acquire this example, please refer to Example scenes - MRTK 2 | Microsoft Learn.

    According to Eyes and hands - MRTK 2 | Microsoft Learn, you may need to disable hand rays when you are using a combination of eye gaze and hand gestures as your interaction scheme. Due to potential version differences in the MRTK package, you may not see "DefaultItControllerPointer" in the pointer settings. So, we recommend that you use the input profile EyeTrackingDemoPointerProfile in the example scene mentioned above as a reference.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.