Search Unity

Rotate CameraRig based on Oculus Controller Rotation

Discussion in 'AR/VR (XR) Discussion' started by Jung-Lee, Feb 21, 2019.

  1. Jung-Lee

    Jung-Lee

    Joined:
    Jan 22, 2014
    Posts:
    19
    I was trying to access the rotation of the Oculus controller so that i can rotate the Player Rig to create an illusion that world is rotating.

    I am using SteamVR, so my code will look when i access the rotation of a right hand controller

    int rightIndex = SteamVR_Controller.getDeviceIndex(Steam_VR_Controller.DeviceRelaion.RightMost);
    SteamVR_Controller.Device rightDevice = SteamVR_Controller.Input(rightIndex);
    Quaternion rightRotation = rightDevice.transform.rot;

    now the Question How to Find out if the Controller rotated right /Left and how do i decide and rotate the player.