3

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

David
  • 37,109
  • 32
  • 120
  • 141

1 Answers1

2
  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
David
  • 37,109
  • 32
  • 120
  • 141
Hristo
  • 1,805
  • 12
  • 21
  • Thanks but I'm looking for a build in solution of GearVR. I have the feeling that there is one, and I'm missing it. – David Jul 11 '17 at 06:38
  • @David If you meant to say 'built-in' solutions for the `Oculus`, for the pointer I believe there are none, for your menu check out [this](https://developer.oculus.com/documentation/mobilesdk/0.4/concepts/mobile-unity-design/) document from the dev. forum. Good luck! – Hristo Jul 11 '17 at 06:51
  • Yes, I'm looking for a `build-in` solution. But I think you missed my point. I don't care about the menu in the image, it could be any simple button. I'm trying to understand how to implement selection with the controller – David Jul 11 '17 at 06:58
  • 1
    @David Quote: "how to implement selection with the controller" Answer: using a `LineRenderer` :) – Hristo Jul 11 '17 at 07:11