#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:
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.
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.
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