Unreal AddDynamic() Delegate Is Not Working

There are multiple reasons why a function that was bound using AddDynamic() may not get called or appear not to work in Unreal Engine C++. This Tutorial will cover some of those scenarios and how to solve them.

Common Developer Mistakes

  1. You are not getting Delegates by reference before you call AddDynamic On Them. You should almost always get a reference to the delegate, not a copy. Example of how NOT to do it:

    FDelegateName theDelegate= getDelegateFunction();

    This is wrong and you will get a copy instead of the delegate you want to bind to. Instead, use:

    FDelegateName& theDelegate= getDelegateFunction();

    Emphasis on the ampersand sign( get by reference).

  2. The delegate is not getting Broadcast anywhere in the code. If Delegate->Broadcast is not getting called anywhere in the code, that means listeners(functions) will never get triggered. Sometimes this may be your error if its a custom delegate or a bug within the engine itself if its an engine delegate. The delegate may not have ever been called.

  3. Garbage Collection. Check if your delegate owners or broadcasters are not getting deleted on invalidated by the garbage collector. Ensure you have protected/or added them for reference counting by using UPROPERTY where appropriate.

You can send us an email for free support if you still couldn’t solve it.