How do I include LyraGame in my GameFeature Plugin? [UE5]

I have created a new GameFeature Plugin in the LyraStartingGame Example and am now trying to add a new class that derives from ULyraCameraMode like this:

#pragma once

#include "CoreMinimal.h"
#include "Camera/LyraCameraMode.h"
#include "Curves/CurveFloat.h"

UCLASS(Abstract, Blueprintable)
class ULyraCameraMode_MyPluginCamera : public ULyraCameraMode
{
	GENERATED_BODY()
...

Visual Studio tells me, that it can not load source file “Camera/LyraCameraMode.h”. And when I try to compile anyway I unsurprisingly get about 12 thousand Errors (not exaggerating).

I assume that this happens because I have not properly set dependencies for my plugin, but I can’t find out where I can set these.

I have added this bit in my Plugin.Build.cs:

		PublicDependencyModuleNames.AddRange(
			new string[]
			{
				"Core",
				"LyraGame"
			}
			);

Is there anything else I need to reference? I’ve been stuck on this for way too long.

Thank you very much for your time.

1 Like

Hiya!

Did you ever figure this out? Think I’m gonna get stuck here for a while too.

I’m attempting to create my own Lyra Plugin so that I can create my own mods and be able to move them to other projects if needed. Here are the public dependencies I’ve used inside my .build so far.

I wanted to make my own GameFrameworkComponent and hit the include errors. I added “ModularGameplay” and “GameFeatures” and generated the Visual Studio project to stop intellisense from complaining.

Hope this helps :slight_smile:

Edit: I tried #include “Camera/LyraCameraMode.h” and it’s not complaining.

1 Like

I tried extending the ALyraCharacter class and was missing “AIModule” and “GameplayAbilities” dependencies.

I got this working in 5.3 by adding “LyraGame” also to my PublicIncludePaths as well. Looks like the PublicDependencyModuleNames list does not do that automatically.

For anyone else, in my experience I had to add the module dependencies and THEN create the c++ files for intellisense to work in Visual Studio.

I was struggling because I created the C++ first and tried to correct dependencies afterward.