I have UI button that rotate an object in the scene when pressed with the MouseDown and stopes rotating when MouseUp.
I am rotating the object using the following code:
private float rotationSpeed = 205f;
public void dragBrain(GameObject brain) {
float rotateX = Input.GetAxis("Mouse X") * rotationSpeed * Mathf.Deg2Rad;
float rotateY = Input.GetAxis("Mouse Y") * rotationSpeed * Mathf.Deg2Rad;
theObjectToRotate.transform.Rotate(Vector3.up, -rotateX);
theObjectToRotate.transform.Rotate(Vector3.right, -rotateY);
}
When I test the application with unity, it works fine (without VR), but when I build the project and test it on an Android device, the object doesn't rotate when I click the button.
Is it because I am trying to get the axis of the mouse? and its different with the VR?
And how should I go about doing it? because I tried to look for the documentations but with no luck.