Forum Discussion
robertsonce
9 years agoExplorer
Use mouse to control Oculus scene -- problems with Y axis
Hey guys,
Here's my question: How do I use the mouse to all directions from a first person perspective, and display the product in the Oculus? Would really appreciate any new tips!
Details:
Before clicking "virtual reality supported", the first person character in my scene can look up/down/right/and left using the mouse or joystick. After turning on VR support (with an Oculus DK2 plugged in), I can only look left or right in the scene using the mouse. I've lost control of rotation along the y-axis (looking up and down). Critically, I can still look all directions using the Oculus.
This is, of course, unconventional. It's for the purpose of a neuroscience experiment (need to be able to separately manipulate the visual / motor input in the VR scene).
My system details: Windows 10, Unity 5.4.4p1, Oculus DK2, Runtime 0.8 (same problem with 1.3)
Thanks for any help!
14 Replies
Replies have been turned off for this discussion
- robertsonceExplorerQuick edit: I'm trying to get control of the pitch axis in the Oculus using a mouse or joystick. Thanks again!
- MikeFTrusteecreate an empty GO and make your camera object a child of it. Attach the mouse look script to the parent and you should be good to go. Get ready to feel sick :)
- robertsonceExplorerThanks so much for your help, Mike!
I did as suggested (screenshot attached), but still have the same problem (can look left and right in the scene but not up and down). Any further suggestions?
Thanks again,
Caroline - vrdavebOculus StaffUse OVRCameraRig instead of OVRPlayerController.
- robertsonceExplorerHmm. This suggestion produced an error: "NullReferenceException: Object reference not set to an instance of an object". Screenshot attached. Any thoughts on next steps here?
Really appreciate your help!
Caroline - robertsonceExplorer
- vrdavebOculus StaffLooks like there is still an OVRPlayerController script instance somewhere in your scene. Might want to right-click OVRPlayerController.cs and choose "Find references in scene" and then delete each one.
- robertsonceExplorerThanks again Dave! Do you also suggest making an empty GO, adding the OVRCameraRig as a child of the GO, and then adding the mouselook script as a component of the parent GO? If so, it seems I have to edit the mouselook.cs script to have MonoBehaviour. Sound right to you?
If so, this is the result of what I think your suggestions were. No luck! I'd appreciate any tips on how you'd go about doing this (using mouse to control the x and y axes of the scene displayed in the rift).
Screenshot above. - vrdavebOculus StaffLooks like you have it set up right! That error is probably from a previous run. Try clearing the console and running again. Does it work when the editor is playing?
- robertsonceExplorerYou were definitely right about that error being a red herring. I opened a new project and walked through the same set of steps as described above. (Screenshot attached).
Now, I cannot rotate in the scene using the mouse input (or joystick input for that matter).
If I replace "OVRCameraRig" with "OVRPlayerController", I can rotate left-right in the scene but not up-down using the mouse (or joystick).
In both cases, I can rotate all directions using the oculus.
Unity v5.3.4p1, Oculus Utilities v1.3.0, OVRPlugin v0.1.4.0, SDK v0.8.0.0
Thanks again for your help! I've been at this for days...
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device