user650261
user650261

Reputation: 2264

Reproducing Hololens Gesture tutorial with HoloToolkit

Not sure if this is best suited for here or Unity or MS forums anymore, but we'll try StackOverflow.

I've been trying to reproduce Hololens tutorial 211 using the HoloToolkit. I'm just trying to do section 1, and reproduce the hand recognition.

In this situation, I've used all the files that are in the HoloToolkit that shared a name with those in the tutorial - except for Singleton, which seems to work differently in the two cases. For any files in the tutorial that were not in the Toolkit, I copied them over.

While the HandsManager is triggered and private void InteractionManager_SourceDetected(InteractionSourceState hand) gets called and sets the handsDetected to true, and handDetectedGameObject is set to active, nothing seems to change regarding the cursor. I'm not sure what information would be useful to reproduce this beyond what I wrote (I don't think it makes sense to drop so many files here on SO), but does anyone know why this might be? I'm using the same CursorFeedback script and I've attached the HandDetectedFeedback prefab as its HandDetected Asset, using a homemade prefab with a Billboard.cs component as the Feedback Parent.

If any more information here is useful let me know and I can provide it.

Upvotes: 2

Views: 961

Answers (1)

Cameron Vetter
Cameron Vetter

Reputation: 747

I haven't looked at the tutorials in a long time, but last time I did they were horribly out of date. Getting input from the Toolkit has changed dramatically since they were written.

You need to add the InputManager component to your scene from the Toolkit. Then create a script and add it to your scene that implements the interface ISourceState and implement "OnSourceDetected" and "OnSourceLost", which trigger when a hand is detected and when it is lost.

For more details you can reference the documentation from the HoloToolkit:

https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit/Input/README.md

or check out the more complete tutorial that is up to date I have on my web site. This part of the tutorial specifically implements hand and click recognition:

http://www.cameronvetter.com/2017/01/03/hololens-tutorial-finalize-spatial-understanding/

Upvotes: 2

Related Questions