Skip to main content
Participant
August 4, 2014

Rotate OVR player with key input

I saw another post in the reporting issues thread but with no answer, so i thought the unity integration thread is the right place for this. With the old sdk i could rotate my ovr player by keyinput with Q and E, which is essential for me because we use a single thumbstick controler to move arround in the rift demos. But now with the new sdk there is no smooth rotation possible with Q and E. It is more like jumping to differnt angles. :(
    This topic has been closed for replies.

    9 replies

    Inspiring
    August 5, 2014
    Can you map your controller's input to the Mouse X or an XInput axis? That should still give you continuous rotation.
    di3ensionAuthor
    Participant
    August 5, 2014
    Unfortunately not, i have already tried to remap the stick. It would be interesting to know, what happened with the old q and e rotation and why it doesn't work anymore.
    Participant
    August 5, 2014
    You can rotate camera smoothly with changing code located the "line 315" in "OVRPlayerController.cs" like below.

    //Use keys to ratchet rotation
    // the variable "0.1f" is for managing rotation speed and you can define it by yourself.
    if (Input.GetKey(KeyCode.Q))
    YRotation -= RotationRatchet * 0.1f;
    if (Input.GetKey(KeyCode.E))
    YRotation += RotationRatchet * 0.1f;
    di3ensionAuthor
    Participant
    August 5, 2014
    Thx for the input, i am quite a scripting noob. The problem is, when i change the values it is still a ratchet rotation. I need a smooth roation like in the old sdk.
    Up and Coming
    August 5, 2014
    For some reason I had a ton of issues turning the OVR for rotation or movement along waypoints. One approach that worked great for me was no longer rotating the OVR. Instead, I have an object (say a cube) that isn't rendering, the OVR is a child of this, and all movement is on this parent object. I now see the results I expect, without mucking up the OVR.
    Cubicle Ninjas Custom VR App Development Guided Meditation VR for Rift, Gear, and Go
    Inspiring
    August 5, 2014
    "di3ension" wrote:
    It would be interesting to know, what happened with the old q and e rotation and why it doesn't work anymore.

    Continuous keyboard rotation was causing nausea in our tests. However, we still support continuous gamepad rotation. Since you're not using an XBox controller, it will require a small code change. You can add Input.GetAxis("MyThumbAxis") to the following value in OVRPlayerController.UpdateMovement():

    float leftAxisX =
    OVRGamepadController.GPC_GetAxis((int)OVRGamepadController.Axis.LeftXAxis);
    di3ensionAuthor
    Participant
    August 6, 2014
    Is it possible to move forward and back by mouse input using the y axis? That would be great because i have a mouse mapping for our controller.

    i tried adding

    // Move
    if (Input.GetAxis("Mouse Y")<0) moveBack =true;
    if (Input.GetAxis("Mouse Y")>0) moveForward =true;
    Participant
    August 6, 2014
    "di3ension" wrote:
    Thx for the input, i am quite a scripting noob. The problem is, when i change the values it is still a ratchet rotation. I need a smooth roation like in the old sdk.


    Please make sure you use Input.GetKey, not Input.GetKeyDown.
    di3ensionAuthor
    Participant
    August 6, 2014
    As you can see, a real script noob :D! Thanks alot, everything works out perfect again !!