.uproject does not list plugin 'XRBase' as a dependency, but module 'MyGame' depends on 'XRBase'.

Hey there!

I’m using Unreal Engine 5.4.4.

I’m learning how to develop a VR game with C++. To do it, I’m checking the Blueprint’s VR Template project. My first thing I’m doing is replicate the blueprint VR Pawn in C++. This is what I’ve done in my project:

I have added the OpenXR and OpenXRHandTracking:

These plugins are enabled in the .uproject:

"Plugins": [
	{
		"Name": "ModelingToolsEditorMode",
		"Enabled": true
	},
	{
		"Name": "OpenXR",
		"Enabled": true,
		"SupportedTargetPlatforms": [
			"Win64",
			"Linux",
			"Android",
			"VisionOS"
		]
	},
	{
		"Name": "OpenXRHandTracking",
		"Enabled": true,
		"SupportedTargetPlatforms": [
			"Win64",
			"Linux",
			"Android",
			"VisionOS"
		]
	}
]

But in MyGame.Build.cs I have added this:

PublicDependencyModuleNames.AddRange(new string[]
{
	"Core",
	"CoreUObject",
	"Engine",
	"InputCore",
    "EnhancedInput",
    "XRBase",
	"HeadMountedDisplay",
	"UMG"
});

Do I have to add XRBase module here or OpenXR?

How can I fix this warning?

Thanks!

Enabling the XRBase plugin from the plugins menu should fix the warning.

To access the XR system from C++ code, it is probably enough with those dependencies. You only need the OpenXR module there if you need any of the few features that aren’t abstracted by the HeadMountedDisplay module.

2 Likes

Thanks for your answer.

Is there any documentation, video or tutorial about how to start developing VR with OpenXR and C++?

Thanks again.

By the way, the XRBase plugin is already enabled:

But it isn’t in the .uproject file:


"Plugins": [
	{
		"Name": "ModelingToolsEditorMode",
		"Enabled": true
	},
	{
		"Name": "OpenXR",
		"Enabled": true,
		"SupportedTargetPlatforms": [
			"Win64",
			"Linux",
			"Android",
			"VisionOS"
		]
	},
	{
		"Name": "OpenXRHandTracking",
		"Enabled": true,
		"SupportedTargetPlatforms": [
			"Win64",
			"Linux",
			"Android",
			"VisionOS"
		]
	}
]

I haven’t seen any documentation anywhere at least.

Try unchecking and checking the plugin. It’s probably been implicitly enabled by the OpenXR plugin.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.