Download

How do you actually enable VR in a packaged project? Enabled HMD isn't working

VR preview works fine but I’d like to put VR in my actual game now :smiley:

When I do Enable HMD and get the results, the results are always false.

I had to connect “event begin play” with “execute console command” - stereo on in level blueprint.

Hi!

I have the same issue. Good to know any solution!

sorry for use your post instead of create a new one

bye

If you are using 4.11 or newer, simply add “-vr” to your command line option.

There is also a .ini file setting iirc.

Tried this, didn’t work :confused:

Command line option? Where? How can I do this in-game real-time? (I need it to work for launched game from unreal, not just a packaged project, because this must be changed in real-time. The player accesses options before entering VR)

Ah, that’s different then, I was talking about starting the game straight into VR. To change the mode after you have launched a game, look at the command “stereo on”.

Ah yeah, unfortunately I’ve tried this… using the console commands stereo on, hmd enable, etc, they don’t seem to work. At least not 4.12. I’m not sure if it’s bugged or it works differently or something… but I can not get it working at all, even in a new project.

I’ll try with 4.11 and see if maybe it’s a bug… bit frustrating since 4.12 is otherwise better for VR. But I suppose that’s the problem with test versions.

Edit: The console commands work in VR preview, but not any other mode…

Thanks SiggiG! it works for me because my “game” in entirely in VR. The correct way to do that is creating a .bat file with the game executable and adding -vr? even for commercial games?

Commercial games either have a launcher or are launched through a store like Steam or the Oculus Store. In those cases the games can specify startup parameters.

Hmm that is odd, I did try this with 4.12 last week. Are you running the game standalone or trying to do this from a viewport in the editor?

There are some changes to how VR is triggered in 4.12, like the fullscreen command (alt+enter) not triggering VR anymore.

Both… It doesn’t work in any version, stand alone, packaged, etc. The only time the console commands work for me is in VR preview which works perfect fine.

This is pretty frustrating.

I got this working (4.11 I think) by putting a 2 second delay node coming off of the “Event Being Play” in my Level Blueprint, followed by the “Enable HMD” node. Without the delay, it seemed like the lightmaps were not loading and everything was dark or not rendered at all.

You don’t need to use a .bat file - you can append the launch parameters directly to a Windows shortcut.

Didn’t work unfortunately… still does nothing and returns a value of false.

I’m starting to seriously get worried my Rift is busted or something… is it not being detected properly by unreal?

Can someone comfirm that in a new project in 4.12 if they do enable HMD it works?

VR preview works for me like I said but otherwise every single VR command does nothing. I’m ready to distribute my project but I can’t because of this…

Edit: If I package my project and add -VR to the shortcut, then it works… this is kinda silly though, can I not do this in game? I don’t want to have to include a shortcut and an EXE and get people confused… My entire purpose here is letting the player manage this in-game in an entirely intuitive manner.

With -VR all the VR commands work. Without it, they don’t. Is there no way I can default -VR, or no way I can add it with blueprints in game? No way I can force it? No way I can do -VR console command? (stereo on / hmd enable ONLY work when it’s ALREADY in VR mode… IE VR preview or adding -VR command line. I NEED This to be accessible in game like it seems it should be)

Pinworm, I just tested with Unreal 4.12 and it works fine?

  1. New project
  2. Simple map with one object.
  3. Run the game (non VR, not through editor)
  4. Open console and write “stereo on” and voila… I’m in VR, using a Rift CV1.

Does that not work for you? What HMD are you using? What version of Unreal?

Okay, this works once packaged… The issue is this doesn’t seem to work in “launch stand-alone game” through the editor. I was using that and assuming it wouldn’t work in a packaged game, but trying it with a packaged game it works. Just need to keep that in mind (seems like a bug?)

Thanks for helping me debug :slight_smile:

No worries, glad to help :slight_smile:

Just a heads up to anyone else stumbling into this thread:

There is a new way to get your packaged builds to start in VR. It’s a very simple setting you have to enable:

Edit -> Project Settings -> Description (under Project) -> Settings (very bottom) -> “Start in VR” (off by default)