Forum rules - please read before posting.

VR Head Turn

Hello,

Is there a way to implement the VR Head turn mechanic? Basically when you turn your head you move in that direction. I currently have a bit of script put together to pull it off. It works ok but if you move in a certain direction using the VR cameras view angle the camera becomes very shaky. Not sure if there is a work around this yet?

Comments

  • So turned out to be a dodgy prefab :/ recreated a new one and my script works fine. In case anyone else wants to see the code, just put inside the PlayerMovement.cs script:

    #if UNITY_STANDALONE || UNITY_EDITOR
                                moveDirectionInput = (moveKeys.y * KickStarter.mainCamera.ForwardVector ()) + (moveKeys.x * KickStarter.mainCamera.RightVector ());
    #elif UNITY_PS4
                                Quaternion headRotation = InputTracking.GetLocalRotation( VRNode.Head );
                                Vector3 lookForward = headRotation * KickStarter.mainCamera.ForwardVector( );
                                Vector3 lookRight = headRotation * KickStarter.mainCamera.RightVector( );
                                moveDirectionInput = (moveKeys.y * lookForward) + (moveKeys.x * lookRight);
    }
  • Not all of us know code..where do we put it?
    That's a fairly large script to just make a guess.....
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.