Delegate works in Blueprint but not c++

Hello,

I am having some troubles with a c++ delegate that I have created. I have an object(named ParentObj for sake of example) with a component (named CompObj for example). This component has a Dynamic Multicast delegate:

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCompCompleteSignature);

In the header of the component I have:

FCompCompleteSignature CompleteComp;

In the ParentObj, I am calling a function when this delegate is executed:

GetCompObj()->CompleteComp.AddDynamic(this, &ParentObj::SomeFunction);

For some reason SomeFunction is never called. I know that the delegate is being broadcasted because I am able to define functionality in blueprints when this delegate broadcasts and it works. IE. if in blueprints I go: event CompleteComp - > do something node, the do something node fires correctly. It just seems that the c++ function never does.

There is nothing strange about this function either. The header containing it looks like this:

public:
UFUNCTION(BlueprintCallable, category = somecategory)
void SomeFunction();

The .cpp looks like:

void ParentObj::SomeFunction()
{
//do stuff
}

Any help you can provide would be greatly appreciated. I am sure it is just something that I am doing wrong.

Im Having the exact same issue, did you find a way to solve this?

In C++, are you calling GetCompObj()->CompleteComp.Broadcast() when the delegate is supposed to be fire? Or are you firing it from BP?

Hey, I was only experiencing this issue in 4.10 - I am now using 4.14 and it works completely fine with the above implementation. Sorry, I couldn’t be of more help.

Hey, the delegate was being broadcasted from C++ using CompleteComp.Broadcast(). That said, I only experienced this issue in 4.10. I’m on 4.14 now and it seems to be working fine with the above implementation.

In my situation it appears that this bug only existed in version 4.10. I have upgraded through several versions all the way up to 4.14 since originally posting this question and have not seen the issue since. For this reason, I will mark this as answered.