"Cannot open source file" on generated engine files?

I’m trying to set up an AnimInstance using the following include statement:

#include "AnimGraphRuntime/Public/KismetAnimationLibrary.h"

However when I try to compile, Visual Studio throws an error that it can’t find the source file “KismetAnimationLibrary.generated.h.” When I open up KismetAnimationLibrary.h, the generated file does indeed appear to be missing. I know how to regenerate files on my own project, but not on the engine itself. Ideas? Using UE 5.0.2.

This may be a longshot, but I had a similar problem some time ago with other files not being able to be found. Have you tried including the “AnimGraphRuntime” module in your build settings? In your game’s .Build.cs, add

	PublicDependencyModuleNames.Add("AnimGraphRuntime")
2 Likes

In the documentation always look for the include section

Under the area References:
Include #include “KismetAnimationLibrary.h”

This is the part you want to include not the full engine path
And as stated above check the documentation for the part where it says module: AnimGraphRuntime