VR Does not Start in Standalone Game

My VR works fine in VR preview but it will not start in standalone game.

I toggle VR as per the following BP. Any ideas as to what I need to do to get VR to work. Thanks.

By Standalone Game do you mean a packaged game or what? Which HMD are you using?

Use Vive and Standalone Game from the editor Play option, the VR Preview is fine. I just found something that indicated that VR does not work for Standalone games selected from within the editor which would explain why I’m not seeing it work.

Is there an simpler way to test this without packaging a game to create a compiled version of the game as I’m trying to develop and test something that does not work in VR preview (I bought it from Marketplace and I need to tweak how it works with my game) and to have to test it each time after creating a package is not feasible (it takes hours to go through a package build …)

Sure. You can run a non-packaged standalone version of your game as described in the official documentation here.This is the relevant part:

Running from outside the UE4 Editor

You can also run a non cooked Standalone game by first creating a shortcut to the UE4Editor.exe and then supplying the following command line arguments.

UE4Editor.exe [MyProject] [MyMap] -game

Note that [MyProject] needs to be the absolute or relative path to your .uproject file.

i just went into project settings and ticked the box start in vr and it works with my rift.

No luck doing that with vive. Also tried -vr als commandline parameter for standalone launch option, didn’t work either.

You can test non-packaged standalone by navigating to your ue4project.exe file, right-clicking, play.

Testing for Vive can be a pain-in-the-ass. It seems half the time it will just work, the other half you have to make sure that the headset and both controllers are awake and visible by the sensors, akwardly holding all devices up with one hand, launching the project with the other hand. Will still sometimes not work. Oh, also make sure steam and steam vr are running.

No such trouble with oculus, except forgetting to tick “launch in vr”.

This is just a wild guess, cause I remember having a similar sounding problem like a year ago… But I had to add an Execute Console Command to my Event BeginPlay that runs “stereo on”, in order to get VR working in one of my projects that I tried to turn into a standalone package. Not sure if that’s still necessary, or if they already include it in the UE4 templates these days. heh but sometimes it ends up being something small like that.

At some point this was true. The command is deprecated now. Now its vr.enablehmd true or you can use the Blueprint node for it. Still doing that, but it does not work when launching the Standalone game window, whatever the reason.

Hi all!

Also having this issue big time! Even Unreal BP VR Template does not function in any other mode than VR Preview! I have tried all the tricks listed in this conversation with no luck. Has anyone managed to solve this or have some advice? Would be much appreciated!

you need to right click the .uproject file and select “Launch Game”. But this way you are not connected to the Editor and can’t use blueprint breakpoints. PrintString works though and if you have C++ code, you can attach to the standalone game with the Vidual Studio debugger. Launch Game needs Development Editor build. Using the commandline you can also launch it in debug.

I had a similar issue while packaging for Htc Vive. I corrected the issue by going to project settings, description, settings and checking start in VR.

isn’t there a simple way to launch the VR-Mode with the Game-Mode?

I mean… when I hit the PLAY button, I basically simulate the game mode.
When a simple rotation on an animation is setup - you can see the animation within the game mode.

But when launching with the VR-Mode, by default it looks like it’s just launching the VR-Mode with the Editor-Mode.

Is there no simple way to launch the VR-Mode with the Game mode?
So you can see the animation when using the VR?

I ran into this as well in 4.24. And it’s as simple as creating a new project using the VR template and running it with no modifications. In 4.22, this works fine for me. In 4.24, I wind up with a black screen in VR when launching the program, but it works fine in VR preview. Nothing particularly interesting in the output log. The screen running on the desktop isn’t black but shows the level as normal.

It seems to either be a bug in 4.24 or they changed something so that now you have to turn desktop VR on differently.

My setup is Oculus Quest using Oculus Link to run desktop VR apps. Not really related, but I can build the Quest native version of the VR template project in 4.24 and it runs fine. It’s just when run on desktop that it’s a problem.

Packaging works, I can run the .exe, VR display & tracking are OK (headset) but controllers are disfunctionnal (hands stay on the ground, not following controllers).

Working with HTC Vive / UE4.24 / SteamVR 1.9.16 and the demo project from Valve SteamVRInput (in description SteamVR Input for Unreal in Code Plugins - UE Marketplace)

In Play / VR Preview it works fine, I can teleport, grab objects, shoot arrows (sample map Valve’s sample project for UE4.24), but once packaged in a .exe the controllers are lost.

This is the closest I’ve come to get a functionnal Vive .exe project, if anybodoy as a solution path it would be welcomed.

Steps taken:

-SteamVR plugin options for VR Manifest & controller binding
-Projects settings / Engine/ Inputs / Check bindings
-Projects settings / Settings / Start in VR is checked

Previous setups:

-UE4.24 VR template project: OK in VR preview, .exe won’t launch in Vive (I can see the scene on the PC screen, but I only get the loading prompt in the Vive)
-UE4.23 VR template project + SteamVR input plugin: Same as 4.24

Since I get consistant results in the VR preview, I’m specifically looking for problems with the .exe packaging.

Any follow up on this? I’m having the same issues as others that I cannot get VR to work on a packaged exe. I need the game to have a menu on the desktop with a simple UI that allows the user to choose whether to start the level using desktop or start the level using VR. I can’t seem to switch from desktop to VR at runtime without the controllers not working.

Any follow up on this? I’m having the same issues as others that I cannot get VR to work on a packaged exe. I am unable to choose the “Start in VR” option in the Project Settings because I need the game to start in a desktop window. I need the game to have a menu on the desktop with a simple UI that allows the user to choose whether to start the level using desktop or start the level using VR. I can’t seem to switch from desktop to VR at runtime without the controllers not working.

as vr_marco suggested above, worked for me

Same issue for me, using UE 4.25, Oculus Rift S, done everything mentioned here *checking start in vr in project settings, etc) but so far, no vr when I start the game, wether It’s packaged or using the play game option when right clicking the project shortcut. Any help? I don’t UNDERSTAND why a template needs so much work to do what It’s supposed to do. I love Unreal rendering quality but there are so many things that don’t work seamlessly.

Having the same exact problem right now! I also need to have a desktop UI which offers a selection mode to the user. On top of that, the user needs to be able to hit a button to exit VR, and hit a button on desktop to go back into VR.

I have this functionality working in Standalone mode from Editor. However, a packaged game will only ever work for pancake (not VR). Not sure if I actually have to push the build to Oculus in order for VR to work, even though the app shows as “running” in Oculus Home.