Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
cdngater's avatar
cdngater
Honored Guest
10 years ago

Project with OVR always builds for Rift, even if not used?

I have asked this on the unity3d forums as well, not sure if it's a unity problem or a oculus integration problem.

Using the following
Unity 4.6.3f1
Oculus Integration 5.0.1

I have a test project that has an Oculus Camera Rig (enabled) as well as a Main Camera (disabled) in a single scene.

When I build the project it builds as expected, and when I run either Test.exe or Test_DirectToRift.exe it shows up in my Rift as expect.

Here is the issue I am having,

So I go back to my project, disable any Oculus scripts and objects, end enable the Main Camera. In the editor it works as expected, no rift eyes . I build like before, and run either Test.exe or Test_DirectToRift.exe, instead of NOT running in the Rift, it does run in the rift. No rift eyes in Rift either, which is good, just on the wrong screen.

So am I missing something here? Or is it, if you have the Rift OVR classes and DLLs in your project even if you don't use them, when you build, it builds to use the Rift as the output target regardless?

Basically I'm trying to create test were I can run it like normal, and then run in in Rift mode, same build executable for both. Can that even be done? I don't want to really be building two separate projects.

Thanks

6 Replies

Replies have been turned off for this discussion
  • *Removed due to incorrect answer* (was tired so i read the question wrong :P Sorry about that!)
  • Wait, i might have misunderstood your situation...
    is your Rift turned on whenever you play the build for the standard screen??? do you have set your rift in either extended mode or direct mode??? it is important to know because i can't quite figure out exactly what you mean by:

    instead of NOT running in the Rift, it does run in the rift. No rift eyes in Rift either, which is good, just on the wrong screen.


    it is a little confusing to me as i have never experienced people have this kind of problem if their Rift is turned off when playing their recent builds...

    Hope you get it to work properly ;)
  • Hi

    Yeh, I'm not asking how to switch in code, that's something I already do.

    No, I'm talking about building and running the exe.

    My understanding was that the exe did not run on the rift directly, and running the DirectToRift did run on the rift.

    Also, yes my rift is still plugged in and in extended mode, but I thought that wouldn't matter if I just ran the test.exe instead of test_DirestToRift.exe.

    My assumption I guess is that when running test.exe the display would be on my normal monitors, and when I run test_DirectToRift.exe then the display would be on the rift. Instead, they both run in the rift, which means if I want to distribute my test project without rift I have to take the SDK out if the project and make a new build.

    EDIT: interesting, something you said above got me thinking. If I turn off the rift, then the display is in the monitor as I expected. But if the rift is on, then it goes to that instead, even if I have the rift classes disabled in the project.
  • Sorry, this is not really clear. With Unity builds, running YourGame.exe will never work. I'm not sure of the technical reason for this, it just doesn't work. You need to be using the YourGame_DirectToRift.exe at all times (both in Direct and Extended Mode).
  • Ok cyber thanks, I think I understand.

    if we build an exe that incorporates oculus, then it's going to run on the oculus rift if it's turned on regardless and not be software controlled.

    Interesting, as it makes all the nifty switching scripts I see here, totally useless as its going to use the oculus rift anyway if it's turned on.

    So I would need to come up with a message for the user like this: "if you want to run the application in non Oculus mode, then please turn off the Oculus Rift as the drivers will detect it and use it even though it's turned off in this application"?