cancel
Showing results for 
Search instead for 
Did you mean: 

Unity [5.4] OVR assets & OpenVR?

cjwidd
Explorer
If you build a project using Oculus Utilities for Unity 5, convert the CenterEyeAnchor to a SteamVR camera, and set the Virtual Reality SDK to OpenVR, the project will run inside the Editor on Vive. If you build the project, it will throw a 'DllNotFoundException OculusPlugin. I built the same project and sent it to CV1 and I did not encounter this error. Is this a result of the compatibility check that Oculus Home is doing to prevent Vive from running Oculus titles, or is this some sort of file path error and it's just not finding the .dll?
5 REPLIES 5

solidsnake4444
Honored Guest
I didn't even know you could mix these. If possible, I would love if someone could explain/give a tutorial.

Fulby
Heroic Explorer
The entitlement check has to be added manually by the developer, it's not done in the Oculus drivers. Have you checked whether you have a script accessing OVRPlugin - I think that's the C# wrapper around the DLL - and if so try #if'ing it out in the Vive build. It may require something more drastic if Unity is trying to access the DLL itself, but if it's only caused by a script calling an OVRPlugin function it should work.

cjwidd
Explorer
Not sure what the issue is. Again, when building the same project, the DllNotFoundException OculusPlugin is not found when sent to the CV1, only the Vive.

Fulby
Heroic Explorer
I'm not following you, can you provide more details please? In you first post you wrote that the cv1 version didn't have the error, but in the latest comment you write that it did. Which version is showing the error?

At what point do you see the exception? Is it during the build or when you start the Vive/cv1 version?

When you say you 'sent it to CV1' what do you.mean by that?

cjwidd
Explorer
1. "built the same project and sent it to CV1 and I did not encounter this error"
2. "the DllNotFoundException OculusPlugin is not found when sent to the CV1"

FYI: I ended up just re-writing my player controller, but in the interest of why this happened, let me explain:

I had a project with an OVRPlayerController. If I build it, it will run perfect on CV1, e.g. the xbxo one controller will control the OVRPlayerController as it would in the Editor. I needed to port the project to Vive, so I imported the SteamVR Plugin for Unity, applied SteamVR_Camera.cs to OVRPlayerController CenterEyeAnchor, set the Virtual Reality SDK to OpenVR (removed Oculus) - I assumed this would fail for the reason I explain below, but I was curious.

Now, if I run the scene, everything works fine in the Editor, e.g. xbox one controller will control the OVRPlayerController even though it's being rendered to the Vive!. If I build the scene and launch the .exe to run on Vive, I catch the .dll error I mentioned above, which is weird because it worked perfectly in the Editor. The reason, I assume, is because the OVRPlayerController is wrapped in a bunch of Oculus callbacks that fail when the .exe initializes and doesn't detect am Oculus device. I was curious if I could bypass that by converting the camera to a SteamVR camera. This worked in the Editor, just not when I build the .exe.