[CPP] Why doesn't my Broadcast work / Why the delegate is not being called?

There's a delegate:

I add a function to it in another actor:

And call it accordingly (the call is made from the component in which the delegate was declared).

but when this delegate is called, the UpdateWorldMarker function is not called

thx for help

Are you certain that you’re falling into the block of code where AddDynamic is executing?


But, i have message in the log:
[2024.06.20-14.13.39:564][397]LogOutputDevice: Error: Ensure condition failed: this->IsBound() [File:D:\UE_4.27\Engine\Source\Runtime\Core\Public\Delegates/DelegateSignatureImpl.inl] [Line: 1028]

I understand. A very stupid mistake.

Header file before:

protected:
	virtual void BeginPlay() override;

	void UpdateWorldMarker(FName QuestID, FQuestData QuestData);

Header file after:

protected:
	virtual void BeginPlay() override;
       
    UFUNCTION()
	void UpdateWorldMarker(FName QuestID, FQuestData QuestData);

I forgot that DYNAMIC_MULTICAST delegates must have functions labeled UFUNCTION().
:sweat_smile:

Thanks for help.

Nice work. Dang UFUNCTION gets you every time.

1 Like

That’s right :smiling_face_with_tear:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.