Binding Delegates across classes (From Comp to Actor)


I’m a bit confused when it comes to Delegate Binding across classes on C++ from Children components to their Parent Actors. I know that blueprints make this pretty straightforward through the Add Event function. However, I haven’t found an adequate way to do this via C++.


This image is what I want to do in C++. the Delegate in the image has been declared within a C++ Component; I’m looking for insights of how to declare the equivalent of this on a C++ Actor. How should I declare it and bind it within said Actor?

I’ve tried what is in this post but it hasn’t worked in my end.

Try the following setup:

/*Multi-cast delegate declartion inside your header file*/
DECLARE_MULTICAST_DELEGATE_ThreeParams(MyDelegate, FHitResult, bool, float);

//Must be marked as ufunction, otherwise your code won't execute
void DoSomething(FHitResult HitResult, bool bWasBlocked, float Multiplier);

And somewhere in your C++ do:

//Delegate declaration
MyDelegate Del;

//Binding a function
//First parameter means that the function DoSomething exists inside the same C++ object    
MyDel.BindUFunction(this, FName("DoSomething"));

//Executing the DoSomething function

For more information regarding delgates this post may provide some insight.