I have a C++ Dynamic Multicast Delegate in C++ and I Broadcast it in C++, but in Blueprint, the binded event isnt being called.
UPDATE: I found that the issue is the “Bind OnRecieveServers” in BP isnt binding it properly. I checked it with TestDelegate.IsBound() in C++ and its returning false. Any reasons for this?
UPDATE: I made a fresh plugin and used some example code from Plugin and still no luck. Heres that plugin. atecstudios.com/DelegateTest.zip Consider it a test for delegates that i can work on, and when it works i can impliment it into my main plugin. Since working with the main one is messy.
Header:
#pragma once
#include "Networking.h"
#include "SocketSubsystem.h"
#include "SharedPointer.h"
#include "Sockets.h"
#include "AtecConnectLibrary.generated.h"
USTRUCT()
struct FServerStruct
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Server Struct")
FString IP;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Server Struct")
FString PORT;
};
//vvv Delegate in Question
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FTestDelegate);
class ATECCONNECTPLUGIN_API UAtecConnectLibrary : public UObject
{
// GET_GAMESERVERS
GENERATED_UCLASS_BODY()
public:
UPROPERTY(BlueprintAssignable, Category = "AtecConnect")
FTestDelegate TestDelegate;
};
How im calling it in CPP
TestDelegate.Broadcast();
Blueprint:
FULL SOURCE:
CPP: CPP: #include "AtecConnectPluginPrivatePCH.h"#include "AtecConnectLibrary.h" - Pastebin.com
HEADER: HEADER: #pragma once#include "Networking.h"#include "SocketSubsystem.h"# - Pastebin.com