Search Unity

Player Control Behavior Problems with VR Preview

Discussion in 'AR/VR (XR) Discussion' started by Tesch, Jun 30, 2015.

  1. Tesch

    Tesch

    Joined:
    Feb 6, 2015
    Posts:
    10
    I just got Unity 5.1 running great with my kit but now I'm running into player control problems when I go into VR preview - the player controls are really messed up!

    The W and S keys moves the player sideways while the A & D keys move the player forward and back. These movements may even be reversed. I get the same behavior with the arrow keys and the XBox controller. There's also no character rotate and the movement just follows the camera view direction - I hate that! I'd rather have an independent head rotation which is different from the camera view direction.... like a tank turret.

    If I preview in normal mode with VR turned off, the controls work just fine in the game window so I believe the FPS Character controller is correct. I've tried different versions of the standard Unity FPS Controller in fresh scenes but I'm still getting the same behavior.

    Any idea what going on?
     
  2. Tesch

    Tesch

    Joined:
    Feb 6, 2015
    Posts:
    10
    As a sanity check, I uploaded a build to confirm my controller problems. Feel free to download this and let me know if the controls are messed up on your side. If this build works for you, I have a hardware issue.

    Link: http://www.schmedia.com/gamedev/whitebox_150630-1.zip
     
  3. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    311
    I just imported the 5.1 FPS Controller into a new project and all of the key movements work as expected. Also, the Head Tracking and WASD movement are independent of each other. I can look left and hold W to move the character forward (With the headset on, feels like I am strafing right). Trying re-importing the FPS controller. Maybe your project is using an outdated one.
     
  4. Tesch

    Tesch

    Joined:
    Feb 6, 2015
    Posts:
    10
    That worked, thanks! I deleted the entire character folder in my project and imported totally new assets. I now have the corect behaviors working again. I Still can't rotate on the Xbox controler but the mouse works. Do I need to add a game controller script to the character or something?
     
  5. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    311
    If you look at the MouseLook Script in the Assets/Stardard Assets/Characters/FirstPersonCharacter/Scripts folder, the Rotation is only taken from the MouseX and MouseY InputManager Axes. If you want Controller movement and Rotation, either add a MouseX and MouseY with Joystick movement, or add the Horizontal and Vertical movement to the script.

    I'll ask our content team to add Controller Rotational control to the Scripts. So that future updates have this control.