- Home /
I need the x, y, z position value of the point of gaze input (pointer click in google vr) on a plane centered at (0,0,0) and scaled (2,2,2),
The following code gives x, y z coordinate of the point of where mouse is clicked.
public class program : MonoBehaviour {
void Update () {RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition); if (Input.GetMouseButtonDown (0)) { if (Physics.Raycast (ray, out hit)) { Vector3 pos = hit.point; float x1 = (float)(pos.x); float y1 = (float)(pos.y); float z1 = (float)(pos.z); }
I need exact same code for Pointerdown in GoogleVR. I am not able to do this. Please help.
Your answer
Follow this Question
Related Questions
How to pass a click through a button? 1 Answer
Use Event Triggers or something similar on non-UI objects? 0 Answers
How to custom raycast event system like Google VR. 0 Answers
Cardboard VR App only registers raycast when finger is held down. 0 Answers
Find and set the object of an event type with script? 0 Answers