Skip to main content
Up and Coming
June 30, 2014

Unity - Mouse look with OVRCameraController

I want enable VR in an aircraft but I can't use OVRPlayerController because the rigidbody interferes with the aircraft. OVRCameraController works fine but it doesn't support mouse look, which I need.

Is there any way around this?

    5 replies

    Inspiring
    June 30, 2014
    You'll probably need to customize the controller. By default, it's mostly geared for a first-person walking scenario. You could even just drop the default Unity mouse look script, but you will need to edit it to get it to work good for VR.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    ElecmanAuthor
    Up and Coming
    July 1, 2014
    Ok, consider it a feature request then :-)
    ElecmanAuthor
    Up and Coming
    July 1, 2014
    Any mouse look script will not work because the OVR scripts interfere with all parent rotations as well. Try to rotate a game object (via the Inspector) which is the parent of the OVRCameraController. It does not have any effect.

    Did I find a bug or is this a feature?

    Either way, I strongly suggest that this functionality is included in the SDK. Not everyone is making an FPS. Some of us make a game where you sit inside a vehicle and it would be nice to look around without breaking your neck ;-)

    Another scenario where you need mouse look in an aircraft is when you enter "slew" (god) mode and you can freely move around, without the cockpit visible. Now you definitely need to enable mouse look to be able to navigate around the world. With the current setup it gets very messy, having to enable and disable different OVR controllers.
    Inspiring
    July 1, 2014
    The OVRCameraController rotates directly from the script (the parent orientation will not have any effect). However, you can use the "FollowOrientation" parameter to effectively add a parent to the controller.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    ElecmanAuthor
    Up and Coming
    July 2, 2014
    Thanks, that did the trick.

    For anyone else running into this problem, add an empty game object and make it a child of your vehicle. Then make the OVRCameraController a child of that empty game object (Cam in the screenshot). Then set Follow Orientation to Cam. Then rotate Cam with your mouse script.

    cam.png

    That feature request still stands though. It would be nice if this would work out of the box.