Adding BTTaskNode c++ class causes build errors

Hi so any time I add a BTTaskNode class in c++ it causes build errors. Does anyone know how to fix this as I have added the “AIModule” to the build file already which I thought was what the problem could be.

Did you enable GameplayTasks in the build.CS file?

How do I do that do I just add it in the public dependencies?

look for a .cs file in your visual studio project called YourProjectName.Build.cs in that file you will see an array around line 11. you need to add “GameplayTasks” to the array. Something like this…

PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "GameplayTasks" });

you should then rebuild the project

It works now thank you!