Download

Access c++ delegates from Event Dispatchers list in blueprint

Hi, I have declared delegates in c++ class, but now I cannot see them in the Event dispatchers list in the blueprint editor.
Is there a way to do this?
Thank you very much.

Make sure that your delegate handle is marked up with UPROPERTY(BlueprintAssignable, Category=mycat)

Here’s my code



DECLARE_DYNAMIC_MULTICAST_DELEGATE(FSampleDelegate);

UCLASS()
class CPPDISPATCHER_API ASampleActor : public AActor 
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	ASampleActor();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;

	UFUNCTION()
	virtual void SampleFunction();

	UPROPERTY(BlueprintAssignable, category="EventDispatchers")
		FSampleDelegate OnSampleDelegate;

	
};


Thank you.

Should work fine. Make sure you also add “BlueprintCallable” if you want to actually fire/broadcast the delegate from BP as well