Download

Pass options from Main Menu to Game Mode

I have created a Main Menu that can run in desktop or VR mode and allows the user to choose which way to run the game.
When I select desktop or VR mode, I load a new level want the Game Mode to spawn the appropriate pawn.
I have a post login event in game mode that spawns and possesses the pawns but my problem is telling the game mode which to spawn.
I have tried setting a boolean in the game mode from the Main Menu widget ‘bIsVR’ to true or false, but it seems that when ran from the client this isn’t possible.
I also tried saving this boolean to the GameInstance, but it looks like the GameInstance only exists on the clients and not the server.
I then tried saving this value to a game save, but again, the game mode is running on the server and doesnt load the game save from the client
I then tried setting level options open “levelname?vr=true” but again, this wasn’t set from the client side.

What is the best way of going about this? I can’t seem to get any option to work correctly.

Thanks,

Matt

Since ancient times, Unreal has a “Options String” property in game modes that nowadays very few seem to know about:

https://youtu.be/XRbpiF4xvW8

Thanks for the reply.
I actually tried the options string, but this didn’t seem to work from the client side.
I used it on the open command when joining the server. Eg ‘open 192.168.0.101? vr=true’