Migrating to MRTK2: Manipulating Holograms by Grabbing

To be honest, the title of this blog post is a bit weird, because in the Mixed Reality Toolkit 1, the concept of grabbing was unknown, as HoloLens 1 does not support this kind of gestures. But nevertheless, as I am on this quest of documenting all the gems I discover while migrating an existing app to Mixed Reality Toolkit 2, this is one of the things I came across. So, I am shoehorning it in this blog post series — the 8th installment of it already. And the fun thing about this one is that although there is a demo project available, I will be writing no code at all. The whole concept of manipulation by grabbing can be done by simply dragging MRTK2 components on top of a game object. Let's get started.

'Far Manipulation'

This is really extremely simple. If I want to make a cube draggable in the 'classic' sense — that is, point a cursor to it, pinch, and move my hand, and then the cube follows, all you have to do is add a ManipulationHandler to the cube, with default settings: