Search Unity

how to add steam vr (vive) to FPS unity 5.4

Discussion in 'AR/VR (XR) Discussion' started by pan-master, Jun 13, 2016.

  1. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    127
    How to add that freaky steam VR to my Unity standard FPS controler?
    Iam adding a script Steam VR_Camera to FirstPersonCharacter, I click expand
    I get
    upload_2016-6-13_5-57-38.png

    but when I use vive the position of vive head viee do not mach the correct position of FPS/FirstPersonCharacter camera,
    I tried to recenter it manualy by addin a small chagne in steam vr_camera.cs
    but it does not anything
    Code (CSharp):
    1. void Update(){if (Input.GetKeyDown (KeyCode.T)) {
    2.             SteamVR.instance.hmd.ResetSeatedZeroPose ();
    3.         }
    4.     }
    Does anyone know how to set it up?
     

    Attached Files:

    Last edited: Jun 13, 2016
  2. ShripadAgashe26

    ShripadAgashe26

    Joined:
    Nov 5, 2016
    Posts:
    3
    HI sir o also have the same problem i just have a vr headset that supports vr and a xbox pc controller and am developing a vr horror game on it i my self have the same problem that the FPS controller does not change forward.direction with the camera if i look to the left and then press w it moves in the wrong direction its direction is not updating with the camera

    Have you found a solution to it yet if yes please help me in my situation i just want to make a simple game in which the player can look around using the vr headset and move using the joystic
     
  3. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    127
    there might be a walk around it at. each time you start level camera position is set to some position on steamvr play area. The idea could be , Let the steam VR camera set its position on play area, Then you set x,z position and rotation of unity FPS controler to mach steam Vr camera position and rotation, then you parent whole steamvr to FPS controler
     
  4. ShripadAgashe26

    ShripadAgashe26

    Joined:
    Nov 5, 2016
    Posts:
    3
    Thank You sir for ur reply please can you just please help me with a simple code in which the rotation of the FPS controller is changed to match with the rotation of the camera
    sorry for asking such a silly thing i am still a learner and eager to try out new thing ...:)

    :oops:My problem is that after adding the steam vr camera to my FPS controller the character always moves based on the global Z axis, so if I move the camera around pressing the forward key moves the char based on its initial orientation and not the camera's.