How to use OnInputTouchBegin in PlayerController?

I found a ton of example of how to use the OnInputTouchBegin through blueprints but not a single one in programming.
I have created my custom playercontroller class and set bEnableTouchEvents to true. But then what is the function signature of the function that is called when OnInputTouchBegin happens?

Do I need to add a delegate? I tried using that, but OnInputTouchBegin has no AddDynamic functions to it.

Any help?

AddDynamic is a macro, so it won’t show up under the object’s functions (it’s really a wrapper for __Internal_AddDynamic). So yes, what you do is attach a delegate with AddDynamic:

OnInputTouchBegin.AddDynamic(this, &YourClass::Function);

The signature for the delegate is simple, it just takes a ETouchIndex::Type as an argument, void return type.

OnInputTouchBegin.AddDynamic(this, &YourClass::YourFunction);

void YourClass::YourFunction(ETouchIndex::Type FingerIndex, UPrimitiveComponent* TouchedComponent) {
// custom code …
}