cancel
Showing results for 
Search instead for 
Did you mean: 

Based on head orientation change the Touchpad X & Y axis transform in Oculus go

satheedhpa91
Level 2
Have user Below code to move OVER camera
      directionGO = new GameObject();
      _cameraTransform = Camera.main.transform;
       directionGO.transform.eulerAngles = new Vector3(0,_cameraTransform.transform.eulerAngles.y,0);
        Vector2 touchAxis = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad) * Time.deltaTime * SPEED;
        transform.position += new Vector3(touchAxis.x, 0, touchAxis.y);

i need to change the direction based on the head rotation. right now the movement is fixed direction only. 


1 REPLY 1

satheedhpa91
Level 2
I got solution  🙂

i just replace the below code it working
 touchpad = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
        transform.eulerAngles = new Vector3(0, centerEye.transform.localEulerAngles.y, 0);
        transform.Translate(Vector3.forward * moveSpeed * touchpad.y * Time.deltaTime);
        transform.Translate(Vector3.right * moveSpeed * touchpad.x * Time.deltaTime);
        cameraRig.transform.position = transform.position;
reference
https://forums.oculusvr.com/developer/discussion/65650/oculus-go-character-movement-using-touchpad-p...