Call C++ From UBlueprintFunctionLibrary

Hi,

I use an UBlueprintFunctionLibrary to store my static functions about File Management.
But I would like to call one of these functions from an antoher C++ class (also an UBlueprintFunctionLibrary). How can I archieve this ? Does the problem come from a the parent class ?

Thank You !

If I understood correctly you want to call a C++ static function from another C++ static function.
Well if this is the case it’s really simple, just include the first UBlueprintFunctionLibrary class header in the cpp where you want to call the wanted static function and the just wrote:


UMyBlueprintFunctionLibrary::StaticFunctionIWantToCall();

inside the function definition you wish to call it.

Instead if you want to call a function defined in a BLUEPRINT UBlueprintFunctionLibrary then it’s completely different story. It’s possible but it’s a little bit complicated, you need to use FindObject, then iterate through its UFunctions, find the UFunction you want to call and then use ProcessEvent to trigger the function call.