Call Blueprint functions from C++
Hello, How can i call a Blueprint function from C++. So i have a buttonPressed() function that i call in c++ and now i want to do something when the buttonPressed() function was called in my Blueprint.
thanks for any answers
PS.: If anyone knows how i can play matinee in C++ it would be also helpful
//if you want to define a function in CPP that can be redefined or called in blueprint, do this:
//for a function named XXX inheriting from a class named YYY, you would write:
//inside the YYY.h class:
//at the end of the YYY.CPP file:
//the "_Implementation" suffix for the function name is only needed if you use "BlueprintNativeEvent", and if you want to call that function from CPP, you just call " XXX(); " and not " XXX_Implementation(); "
answered Oct 15 '14 at 04:53 AM
Ok, got this working so here is an example....
I want to call a blueprint function from C++.
So first I make a blueprint function called CallFunctionTest. (In our game, and we call a player a "Survivor".) It just prints "Survivor Call Function Test" in pink on the console.
Then I have a static blueprint set of functions like this...
The header file is
and the cpp file is...
Then we call the test function from our SurvivorBP blueprint and it calls the function on the SurvivorBP.
Here are the blueprints
In case you google this and actually want to do what the OP states in the title, here is some code:
To Call Blueprint function node from C++ :
1 - Expose a function handle in C++ Header:
2 - Add the function node to the blueprint event graph
In this example right click on event graph and search for "event start patrolling" and connect it up to whatever you wan to run
3 - Call the function StartPartrolling() from your C++ Code
4 - Profit
Do not Play matinee By C++,if not packet project will fail!
answered Aug 18 '17 at 08:16 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here