How to implement selection with GearVrController - Unity

192 views Asked by At

So I figure out how to add a GearVrController to a scene.

The controller follows the hand movements.

But how can I implement the selection part + a ray from the device to the scene?

I mean a ray that can select item, like the image below that taken from Oculus menus.

I'm looking for a build-in solution from Oculus if there is one. (I don't care about the menu itself, I'm trying to understand how to implement selection with the controller)

enter image description here

1

There are 1 answers

4
Hristo On
  1. For the Ray you could use a so called LineRenderer in Unity. Attach one to your controller and via script you can assign the start and end point (SetPosition(int index, Vector3 position); for indexes use 0 and 1 and the positions are the controller and the whatever you choose).
  2. For your menu, you could use a world based Canvas that sits on top of the controller at all times. You can toggle it on a specific button pres from the controller