David
David

Reputation: 37616

How to implement selection with GearVrController - Unity

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

Upvotes: 3

Views: 192

Answers (1)

Hristo
Hristo

Reputation: 1815

  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

Upvotes: 2

Related Questions