Call Blueprint functions from C++

//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:

 UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "ZZZ")
 void XXX();

//at the end of the YYY.CPP file:

 void YYY::XXX_Implementation()
 {
   //add code here
   AAA.doStuff();
 } 

//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(); "

1 Like