Hello. I'm pretty new to Unity and Adventure Creator so I apologize if this is a dumb question, but there's very little info I could find about VR implementation with AC. At this point my goal is just to be able to walk around a scene in VR using mouse and keyboard with the AC first-person setup, basically just to visualize my scenes as I'm working on them. Following the first-person youtube tutorial and the "Working with VR" section of the manual, I've gotten my VR setup almost exactly how I want it except for one thing, which has me stumped:
The WASD Horizontal and Vertical inputs only move relative to my mouse rotation, but ignore my HMD rotation. More specifically, the WASD inputs seem to move relative to the rotation of "First person camera" but doesn't seem to factor in the rotation of the "MainCameraVR" prefab (which I renamed to MainCamera to replace the prior main camera, as instructed by the manual).
To give an example, if my PlayerStart is facing North, and my HMD starts by facing North, pressing W will move the player North. If I turn my mouse cursor East, my HMD will also be facing East, and pressing W will move the player East. But if my mouse cursor is facing North, but my HMD turns East, pressing W will move the player North, while I'm wanting it to go East. Basically when pressing W I want it to go forward whichever way the HMD is facing, and same idea for A, S, and D.
I feel like the solution must be simple. I've tried everything I can think of, but as I said I don't know Unity or AC well enough to even know where I should be directing my attention on figuring out this issue.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @AndrewWerdna.
I assumed actually that the "VR camera" would be independent of the MainCamera itself, so that "proper" rotation is still handled by turning the player character (to allow for full 360 rotations).
I will consider making this optional, however. Try the following tweak first, though, and let me know how it goes. Open up MainCamera.cs, and find the RightVector and ForwardVector properties (around lines 988 and 998 respectively).
In both, replace "transform" with "ownCamera.transform". Does that produce what you're looking for?
Thanks a bunch, that worked perfectly! And I never would've figured that out on my own.
I'm loving Adventure Creator btw. I've attempted to learn Unity quite a few times over the years but with AC it's finally seeming to stick, so thanks for all your great work.
No problem. I'll look into adding an option of some kind for this in the future.