How to call a function by it's name in blueprints?

For example in set timer function, you choose the function you’re gonna call by it’s name, is there a node like call function by name(takes string function name as input)

Why don’t you search in source for yourself how that node is coded ;] you can search by name via github, most binded function has same name but without spaces, but sometimes may be diffrent then search via name of node with spaces. If node belongs to some class (has “Target” pin for that class object) you will find code of it in that specific class. I can’t post code so you need to set up github access and got to this link:

https://github.com/EpicGames/UnrealEngine/blob/9dad25829a2c2d9a44fb11fab9ce5511323e7788/Engine/Source/Runtime/Engine/Private/KismetSystemLibrary.cpp#L246

As you can see there Object->FindFunction(FunctionFName); which gets UFunction object represanting that node function, then you can use it this i guess but not sure what you should feed FFrame with

If this is too complex for you, i recomad you this method of calling code in blueprint:

-Create base class in native C++ (based from class that as you blueprint that you wanted to call basing) and declare virtual functions with BlueprintImplementableEvent specifier in UFUNCTION() for all calls you need. Keep in mind you don’t need to place any code in cpp… in fact you shouldn’t as you would get errors, those functions will be visible as events in blueprint.

-Now create blueprint based from this C++ class you just made (or change parent of existing one) and you should have those functions as events which you can plug blueprint code to

-Now when you call those functions in C++, code that been generated from reflection system by UHT will call those events in blueprint allowing you to execute blueprint code from C++

This method is a lot simpler aspecially if you creating base classes in C++ and then extend them in blueprint

1 Like

You can find a plugin called “Kickstart Blueprint Library” in UE marketplace.

It has a BP node of “Call Function By Name”, it fire the exact Function.

Here’s the example video

Cheers!

1 Like

you can create your own node , process contain engine modifications, you will need to rebuild the engine if you add this node manually.

hope it helps
cheers!