[Question] Can't delcare Multicast delegate and BindDynamic() is not member of Multicast Dynamic Delegate

Declaration:

#pragma once
#include "../Common/RPGCharacterAttributes.h"
#include "RPGItemEffect.generated.h"

DECLARE_MULTICAST_DELEGATE(FOnTestDelegate);

UCLASS(Blueprintable, BlueprintType)
class URPGItemEffect : public UObjec
{

And now usage:

UPROPERTY(BlueprintAssignable)
FOnTestDelegate OnHealthChangeItem;

1>D:/Unreal/RPG/Source/RPG/Items/RPGItemEffect.h(30): error : In RPGItemEffect: Unrecognized type 'FOnTestDelegate'

???
I’m sure I declared this delegate just above.

Ok, thought not big deal. Try dynamic multicast. Same as before, but now instead:
Binding:

OnHealthChangeItem.BindDynamic(this, &URPGItemEffect::GetHealthValue);

Function I bind:

void URPGItemEffect::GetHealthValue()
{
	//healthOut = EffectOwner->Attributes.Health;
}

1>D:\Unreal\RPG\Source\RPG\Items\RPGItemEffect.cpp(12): error C2039: '__Internal_BindDynamic' : is not a member of 'FOnTestDelegate'

According to documentation, this is how I should do it. As Multicast Dynamic is binded the same way as just ordinary Dynamic.

Hi Lukasz,

The documentation for this is out of date, but has since been updated internally. Multi-cast delegates are declared in the same manner as you declare standard delegates except they use the macro variations specific to multi-cast delegates. Try using AddDynamic() instead, Add is being used currently in place of bind. The updates to documentation will be reflected in a future update.

Cheers!

Alexander

You missed some includes, or maybe just macro like UCLASS(don’t know how it works really ^_^)
Anyway AddDynamic macro locates in Runtime/Core/Public/Delegates.h file

For the life of me I can’t assign a dynamic delegate through script.

AddDynamic(this, &MyClass::MyMethod);

‘__Internal_AddDynamic’: identifier not found

I so wish the documentation had examples…

Been looking at the same code for 2 hours and then all the sudden it compiles. Go figure. Found a good example on the forums.