How to export a VR + Flat game

Godot Version

v4.3.rc3.official [03afb92ef]

Question

What would be the best way to export a game in a way that can be played in both PCVR and Flat modes? (So people don’t need to download the same game twice)

  • Can a single executable switch modes with a parameter?
  • Can I export 2 executables sharing the same data?

So I can provide this option on Steam:
imagen

Using command line arguments would be easiest.

See OS.get_cmdline_args() and OS.get_cmdline_user_args().

1 Like

Looks like a combination of your suggestion with disabling “Startup Alert” on the OpenXR configuration may be the way to go.

And adding a if to the XR initialization:

# XR
if ENABLE_VR:
	interface = XRServer.find_interface("OpenXR")
	if interface and interface.is_initialized():
		print("VR")
		get_viewport().use_xr = true

Will test it, and if everything goes well I’ll mark the question as solved. Thanks!

1 Like