Help with migration to MRTK2

Pedro Zanardi 5 Reputation points
2023-08-14T21:33:21.6166667+00:00

So I'm working on migration project that was used Holotool kit 2017, I got project to work updating interfaces, openxr and other things on Unity 2021 LTS and MRTK 2.8

But there's one interface that not worked properly:

this works on Holotool Kit,

public void OnNavigationUpdated(NavigationEventData eventData)
{
  navigationDelta = eventData.NormalizedOffset;
}

and the docs about migration suggested to replace by IMixedRealityGestureHandler<Vector3>, so I tried:

public void OnGestureUpdated(InputEventData<Vector3> eventData)
{    
	manipulationDelta = eventData.InputData.normalized;
}

But isn't working as expected, eventData or eventData.InputData doesn't have reference to NormalizedOffset.

I tried to replace the generic InputEventData<Vector3> for InputEventData<NavigationEventData> but the OnGestureUpdated simply doesn't work anymore...

Any tips?

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.
386 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pedro Zanardi 5 Reputation points
    2023-08-15T12:08:31.73+00:00

    Maybe it's a thing on old code? The idea is usually to manipulate the object that you picked it. I know that I can use object manipulator + near interaction grabbable but is a bit pain to adjust this code.

    One thing about the old code that I removed is that part:

    InputManager.Instance.OverrideFocusedObject = gameObject;

    eventData.Use();

    It was under OnGestureStarted, maybe is it the cause the code not functioning properly?

    1 person found this answer helpful.