Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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


 #pragma once
 #include "../Common/RPGCharacterAttributes.h"
 #include "RPGItemEffect.generated.h"
 UCLASS(Blueprintable, BlueprintType)
 class URPGItemEffect : public UObjec

And now usage:

 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.

Product Version: Not Selected
more ▼

asked Mar 11 '14 at 02:38 AM in C++ Programming

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.



more ▼

answered Mar 11 '14 at 02:38 AM

avatar image

ue4-archive ♦♦ STAFF
50k 3670 1999 9124

avatar image tgraupmann Feb 01 '16 at 12:52 AM

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


avatar image alkohol Feb 01 '16 at 01:15 AM

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

avatar image tgraupmann Feb 01 '16 at 01:16 AM

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. https://forums.unrealengine.com/showthread.php?61599-C-Event-dispatchers-How-do-we-implement-them

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question