How do I create a cpp function that can be overridden by blueprints?

I’ve look all around for this, but haven’t seemed to find anything.

I have a function in cpp that contains some default implementation, but I can’t seem to expose this function to my blueprint so it can override it. I can expose it as an event or allow to function to be called, but I can’t get the blueprint to override the function.

Never mind, I figured it out just after posting this lol,

but for anyone with the same problem this is a good link that explains this-
https://docs.unrealengine.com/en-us/Programming/Tutorials/VariablesTimersEvents/2

basically you need to declare the function as virtual, add _Implementation() to the end of the function’s name and use UFUNCTION(BlueprintNativeEvent)

ex-

//instead of
void MyFunction();

//do this
UFUNCTION(BlueprintNativeEvent)
void MyFunction(); // do not implement
virtual void MyFunction_Implementation(); // implement default behavior in this function