Today I was following the basic setup tutorial for the Mixed Reality Tool Kit (MRTK). However, I hit a problem, I didn’t see any controllers and the little ‘Hello World’ cube was just stuck on the screen.
I looked around for the some sort of controller component but could not find anything obvious. So I figured I would just build it and see if works okay on the Hololens emulator. It built okay but the app did not launch properly. Looking at the log I spotted the offending line;
NearInteractionGrabbable requires a BoxCollider, SphereCollider, CapsuleCollider or a convex MeshCollider on an object.
That is odd because the instructions in the tutorial state;
‘For the purpose of this tutorial, colliders have already been added to the Cube Object.’
Time to investigate.
I opened the Near Interaction Grabbable script by selecting the ‘Edit Script’ menu from the Inspector.
Aha, so it is using ‘GetComponents’ and not ‘GetComponentsInChildren’. Now for the prefab;
GetComponent on the root Game Object is not going to find any Colliders.
So I simply added a Box Collider to the Game Object…