Hello I'm developing a Virtual Reality App in Unity and I'm using Steam Virtual Reality, VRTK and HTC VIVE. Like in PC we Use "Void OnMouseDown" to detect clicks on a game object, how we can achieve this in Virtual Reality? Suppose We have Virtual Reality scene with a single Cube. Now what I want is to detect clicks on the objects so how can I achieve this in Virtual Reality? Help Me Please Thanks.
public void OnMouseDown()
{
//some code
}
You should refer to this tutorial on VRTK. You can also refer the following example in your VRTK package.
VRTK/Examples/005_Controller/BasicObjectGrabbing
You have two parts for this:
You also might want to go through this. If you need a grabbed object there is a specific function mentioned in document called GetGrabbedObect.
As a first time developer it will be bit confusing to use VRTK but trust me its one of the most powerful tool to make VR games. Secondly keep on checking the tutorial videos about using VRTK and go through the examples folder.