Can't call blueprint function that is defined in another game module (C++)

Hi,

in blueprint, I’m trying to call the function, which is defined in the UBlueprintFunctionLibrary in another game module. Unfortunately, I can’t find the function node in blueprint’s context menu. I’ve added BlueprintCallable tag to the function definition.

My project structure in solution explorer looks like this:

  • Source
    • TheGame
      • TheGame.Build.cs
      • TheGame.cpp
      • TheGame.h
    • TheOtherModule
      • TheOtherModule.Build.cs
      • BlueprintFunctionLib.h
      • BlueprintFunctionLib.cpp
    • TheGame.Target.cs
    • TheGameEditor.Target.cs

I’ve added the reference to TheOtherModule to the *.Target.cs files:
ExtraModuleNames.AddRange( new string[] { "TheGame", "TheOtherModule" } );

Also, I added TheOtherModule as one of the TheGame private dependency:
PrivateDependencyModuleNames.AddRange(new string[] { "TheOtherModule" });

Everything compiles, but nothing works as expected. I tried to remove Intermediate, DerivedDataCache and Build directories, and nothing. Still I can’t call the blueprint function from the blueprint.

Can anyone please help me? I’m stuck and have no idea what I’m doing wrong. Thanks in advance!

You’re missing TheOtherModule.cpp file that implements the module and registers it with Unreal. Check out all the steps to creating a new module here: ari.games - Modules

1 Like

Indeed, I needed to call IMPLEMENT_MODULE macro and then register it in *.uproject file. Thank you!

I expected to call IMPLEMENT_MODULE large scale and afterward register it in *.uproject document. Much thanks to you.