I am having a little trouble transitioning already made games into VR. I have a game that is a simple Raycast shooter (Using Unity’s LetsTryShooter package) and with the mouse and keyboard, the game works great. However, when I try to simply check off the project settings (player>virtual reality supported) the camera allows me to look around, however the mouse still controls where the player moves.
In a simpler example, say I am moving forward by holding W, when I move the mouse, the player continues forward in that direction. However on VR, if you move your head, you continue in the direction that the mouse dictated.
If you still don’t understand the situation, here’s a quick diagram.
Now my problem stems when I my Raycast no longer follows the VR Camera. If I fire when looking to the side, the ray continues forward even though my gun is no longer in that position.
How can I simply change the Input.GetAxis code (in C#) to account for the headset?
