It’s a topic I have seen pop up a few times during my initial research but for some reason there is no ‘Call Function By Name’ node available in blueprints despite how incredibly useful it sounds.
I have seen some folks say I could use the ‘Set Timer By Function Name’ node to emulate a similar result but this felt incredibly hacky to me and so I decided to make my own function as an opportunity to learn how plugins are made.
Sure enough, we eventually got there in the end. Takes a reference to the blueprint holding the function I am looking for and the name of said function as inputs, executes the function and returns True if the function was executed without incident.
Now the question is, I am setting myself up for failure? Is there a good reason why this very basic node is not available as a baseline? Was it simply never implemented? Is it secretly the devil’s work and it will come to bite my in the behind 600 functions down the line?
If this implementation works at all, then likely it’s ok.
I don’t know the epic’s position, but i think that the rough idea is that c++ has no build-in reflection system, hence there is no such things like FindByName by default. But epics need it and they did implement their own system. And since it’s the system “on the top of” of all existing engine code\language, in some cases it will cost you a some part of perfomance to use it.
A simple direct call will definitely be faster than seaching through reflection by string name among all the functions your object has.