VR preview with dedicated server

Hey,

When i am trying to run the VR preview option in Unreal without a dedicated server it works just fine, however when i click the check box to run through a dedicated server i can’t see anything in my oculus HMD, everything is black.

I appreciate all the help, thanks!

I had what may be the same problem, which was due to the Oculus automatic loading screen support not detecting that level loading had finished so it left up a black screen. If it is that, then adding a call from BeginPlay on the level blueprint to HideLoadingSplashScreen with clear ticked worked around the problem for me.

Hi, thanks for your answer. Sadly this didn’t work for me. I did as you said and set the clear to true, the same problem occurred.

Did you find solution? On 4.17 still don’t work.

At my old studio we had this problem. I don’t remember the details of how we fixed it, but there’s some problem with the way the VR Editor Mode works that conflicts with the dedicated server. An engineer on our team disabled VR Mode and got dedicated server working and it was my favorite day in the world.

So ask him when have possibility, I’m not using VR Editor, just VR mode in game preview, its multiplayer game with dedicated server and testing it with VR is nightmare. I’ll be glad for tip how to disable VR mode on dedicated in way to be able still test dedicated + vr preview as client.

If you can modify the engine, applying like the following code will work.

Incidentally the first call of this function is for dedicated server.
2nd and later are for client.
I put it on 4.19.

UGameInstance* UEditorEngine::CreatePIEGameInstance(int32 InPIEInstance, bool bInSimulateInEditor, bool bAnyBlueprintErrors, bool bStartInSpectatorMode, bool bRunAsDedicated, float PIEStartTime)
{
	const FString WorldPackageName = EditorWorld->GetOutermost()->GetName();
	
	bool bUseVRPreview = bUseVRPreviewForPlayWorld && (InPIEInstance >= 0 && InPIEInstance <= 1);
	if( !bRunAsDedicated && bUseVRPreviewForPlayWorld && VRInstanceSpawned == false )
	{
		VRInstanceSpawned = true;
		bUseVRPreview = true;
	}