How to implement selection with GearVrController - Unity

So I am figuring out how to add the GearVrController to the scene.

The controller follows the movement of the hand.

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

I mean a ray that can select an item, like the image below, which is taken from the Oculus menu.

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

enter image description here

+3


source to share


1 answer


  • For Ray

    you can use the so called LineRenderer

    in Unity

    . Attach it to a controller and through a script you can assign start and end points ( SetPosition(int index, Vector3 position);

    for indices use 0 and 1 and positions are the controller and whatever you choose).
  • For your menu, you can use a world-based oneCanvas

    that is constantly on top of the controller. You can switch it on a specific pres button from the controller.


+2


source







All Articles