How do I trigger a C++ script from blueprint

I want to have blueprint start a script in C++, I have seen several things on how to make C++ start blueprint but never the other way around. If possible, I would like to start it from a widget blueprint, but could use a level or most others if I need to.

Thanks a ton, I am a beginner at c++ and unreal and this solves a huge problem for me.

You can make a UFUNCTION(BlueprintCallable) which will show up in Unreal, which you can call in blueprint, and it will run your implementation.

For example:


void GenericFunction();


void CLASSNAME::GenericFunction() 
     // call your own functions or do stuff