Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Hololens Issue wit InteractionManager (sourcelossrisk and selectpressed)

Discussion in 'VR' started by JokesOnMe, Apr 19, 2018.

  1. JokesOnMe

    JokesOnMe

    Joined:
    Feb 7, 2015
    Posts:
    4
    Hey people,

    I'm new to Hololens dev and I'm going through the examples from the hololens academy. Currently, I'm playing around with 211, the chapter talking about gestures and hand tracking. The third section describes hand guidance to provide feedback when a tracked hand is near the boundary of view of the hololens. This example doesn't work and I believe the issue is with interactionmanager. When I select an object, the state returned from InteractionSourceUpdatedEventArgs always has selectPressed as false. Should this not be true when I have used the "click" gesture with my hand on a hologram? If I change this to anyPressed, then I run into an issue with sourceLossRisk. The state object always shows this value to be 1. This is despite me having my hand in the center of view. This value messes up calculation of distance for positioning of the cursor. So, what is wrong with this class?

    The code sets up the event as follows:

    InteractionManager.InteractionSourceUpdated += InteractionManager_InteractionSourceUpdated;

    The function:
    private void InteractionManager_InteractionSourceUpdated(InteractionSourceUpdatedEventArgs obj)

    Then, if I print obj.state information, the selectPressed and sourceLossRisk are always false/1 respectively. This is despite me "clicking" on a hologram and holding my hand in the center of my view. I don't understand why these values never change. Any help to a noob would be appreciated!
     
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
  3. JokesOnMe

    JokesOnMe

    Joined:
    Feb 7, 2015
    Posts:
    4
    So I managed to get around the Pressed issue. However, the sourceLossRisk is always still 1. I'm remoting to the device. Is there a difference in remoting vs going through the process of deploying via Visual Studio? I shouldn't think it would matter.
     
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    There is a known issue with remoting and simulating where loss risk is always 1. To get it not be 1 you need to deploy the app to the hololens.