Skip to main content
Inspiring
July 7, 2015

Oculus Utilities for Unity 0.1.0 Beta released

We have released the Oculus Utilities for Unity 0.1.0 beta. This package has basically the same API as our legacy Unity integration, but it's built with Unity's new first-party VR support (UnityEngine.VR). If you've been using Unity 5.1 with the new "Virtual Reality Supported" player setting enabled, you may have noticed the camera model and feature set differ from what was in the old integration. The Utilities enable you to update existing apps and also access Oculus features not exposed by Unity itself. Questions and feedback are welcome here.

You can download the Utilities and an updated copy of the SDKExamples from https://developer.oculus.com/downloads/.

Be sure to read the documentation at https://developer.oculus.com/documentation/game-engines/latest/concepts/unity-intro/.
    This topic has been closed for replies.

    80 replies

    vrdavebAuthor
    Inspiring
    July 10, 2015
    "MarkM" wrote:
    Turns out that I had somehow messed with the OVRPlayerController in the scene.

    Sounds like you might have set OVRPlayerController.Acceleration to 0? Next time, try opening the script in MonoDevelop and attaching it to the editor (click Run > Attach to Process > Unity Editor). Then you can set breakpoints in scripts like OVRPlayerController to see what they are doing.

    "aurelien" wrote:
    @vrdaveb, would you be interested in getting a bug report with project files to look into the issue?

    Yes, please. That level of slowdown is not expected. Make sure you only have one active Camera in the scene (not counting any special RenderTexture-targeting Cameras for UI, etc).

    "atelierparreno" wrote:
    The prefab is currently trying to access a Gamepad that I don't have.

    Please use InputManager.asset from the zip file that comes with the Utilities package. You need to put that in your ProjectSettings folder. The exceptions are probably causing the slow frame rate. However, since you're on mac, you won't get a good experience with Unity's built-in VR support just yet. There are known issues with judder and tearing there. I would recommend targeting Windows or Android. If you really want to build for Mac, stick to the legacy integration 0.6.0.1 for now.

    "Anticleric" wrote:
    It's not crashing in the editor, so I can't get a bug report from Unity.

    For any Unity issue, you can always click Help > Report a Bug to submit details about the issue along with a (private) project for them to test.
    Inspiring
    July 10, 2015
    EDIT:

    Right eye lighting issue has been reported to Unity.
    Crash has been reported to Unity with better logs.

    Sliding movement was due to bad inputmanager.asset.

    Life is good (or will be soon hopefully).
    Thanks Dave
    IRIS VR - TECHNOLUST - KERSER - BODY/MIND/CHANGE - QUANTUM CAPTURE - OCCUPIED VR
    July 11, 2015
    can you folks consider putting look while walking options into a checkbox? it would help so many to be able to switch from "look to move" vs. 'tank control' (move fwd while looking to the side). A checkbox would also help people using playmaker, super easy to create a toggle for players using set property. Guess I'm just asking to bring this feature out of the shadows if possible.. thanks!

    Update: The thread below helped allot, thanks to peterept I have a nice toggle where players can choose if they like "look to turn/swivel chair" or "tank controls", during runtime.
    viewtopic.php?f=37&t=24147
    Inspiring
    July 11, 2015
    Yes, you can totally experiment with different control schemes. The OVRPlayerControl is just an example, and probably shouldn't be used as-is in a finished game. I'd recommend creating your own custom controller to get the exact feel you're looking for or modifying the Oculus scripts to meet your needs.
    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
    July 11, 2015
    "cybereality" wrote:
    Yes, you can totally experiment with different control schemes. The OVRPlayerControl is just an example, and probably shouldn't be used as-is in a finished game. I'd recommend creating your own custom controller to get the exact feel you're looking for or modifying the Oculus scripts to meet your needs.


    I've been using UFPS, which is overkill for my project... just trying much simpler setups without recreating the wheel.
    Thanks
    Up and Coming
    July 11, 2015
    "vrdaveb" wrote:
    "bteitler" wrote:
    I see this for acceleration:
    "OVRManager.display.acceleration;"
    Is this actually a low latency access to the accel data?

    Right, that is the simplest way to get acceleration. If you want to get it at a higher frequency with a timestamp, consider writing a native plugin and calling ovrHmd_GetTrackingState from it. You will need the ovrHmd handle, which is the IntPtr returned by UnityEngine.VR.VRDevice.GetNativePtr(). If you don't need the timestamp, try copying the code from OVRDisplay.acceleration and removing the VR.VRDevice.isPresent check. Just make sure check it yourself from the main thread before setting up the loop.


    I see - was hoping to avoid native. Thanks for the confirmation though. I would gently suggest making this easier again in the future if possible. I can see a lot of use cases besides mine, such as gesture recognition that might want the highest frequency data and timestamps.

    "vrdaveb" wrote:
    "bteitler" wrote:
    what is the correct way to completely disable head position tracking as well as the head model?

    Normally you would write a function like this:
    	public void UpdateTransform(OVRCameraRig rig)
    {
    rig.trackingSpace.localPosition = -rig.centerEyeAnchor.transform.localPosition;
    }

    and then add it to OVRCameraRig.UpdatedAnchors.
    If that doesn't work, send me a PM.


    Yeah, I came up with something similar which works. It is pretty non-obvious to have to counter-act the head model because it is being enforced under the hood though. You might consider adding a simple option for this back. I know this isn't really Oculus' primary concern, but I'm pretty sure there are quite a few projects going on that use different external trackers, and this would make life much easier (I keep having to dig into the camera code every update).
    Up and Coming
    July 11, 2015
    Thanks for the utilities!
    I was struggling to make my target reticle work as expected with the standard FPS camera while updating to unity 5.1.x.
    With the utilities everything works the same way it used to.

    One question. My game is not mirroring to the 2d screen by default, what did I break?

    Thanks
    Up and Coming
    July 11, 2015
    "atelierparreno" wrote:


    Issues : There seems to be a problem with the Inputs. My character is moving without following the OVR Mouselook.



    Yeah, I gave up with a similar issues, just reset my project inputs to default and used the OVRPlayerContoller prefab from the utilities. Movement is working as expected
    Inspiring
    July 11, 2015
    @wheatgrinder: Can you try this?

    VRSettings.showDeviceView


    To try to turn mirroring on.
    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
    July 12, 2015
    "vrdaveb" wrote:
    Thanks. Also check out the profiler's new Timeline view.


    Dave - just want to say a huge thanks for this. This new view in Unity's profiler is extremely helpful, and I had no idea it existed until you posted this.

    On a side note, I am seeing significant reduction in fps when switching from Unity 5.1.1p3 + 0.5.0.1 integration + 0.6.0.1 runtime to new Unity 5.1.1p3 + 0.1.0utils + 0.6.0.1 runtime and native VR selected. I was near 100fps before the switch, and now I'm around 60fps. My application is CPU bound at the moment, and I do see this in the the known issues listed on the Oculus Utilities download page, so I'm assuming this is the cause:

    Known Issues
    Performance loss. CPU utilization may be slightly higher than in previous versions of Unity.

    Is this something that will be addressed, or is it just a result of all the changes that were made and is not fixable?

    I'm going to try to use this new Timeline view to see if I can debug the difference between the 2 approaches (legacy vs. native + utils).

    Thanks
    ccs