Invoke a "call" on event in c++ defined in Blueprint

I’ve created Event Dispatcher in Blueprint and assign an event, now i want to “call” it in c++. Thanks in advance.

You need to make a BlueprintImplementableEvent and call it in the delegate after it receives a response.

It doesn’t need an implementation in C++, just a declaration in the .h and then calling it wherever you like.

Then you can override it in the BP, and it will be fired off when you receive your response. (AKA whenever you call this function in C++, it will fire in the child BP)

Your BP must be a child class of the C++ class.

Maybe something like this

//FileBrowserBehaviour.h
#pragma once

#include "FileBrowserBehaviour.generated.h"

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRefreshFileNameDelegate);

UCLASS(BlueprintType)
class POLYME_API UFileBrowserBehaviour : public UObject
{
    GENERATED_BODY()
public: 
    UFUNCTION(BlueprintCallable, Category = "File Browser")
    void SelectFile(FString FileName);
protected:
    UPROPERTY(BlueprintAssignable, Category = "File Browser")
    FRefreshFileNameDelegate RefreshFileName;

    UPROPERTY(BlueprintReadonly, Category = "File Browser")
    FString FileName;
};


//FileBrowserBehaviour.cpp
#include "PolyME.h"
#include "FileBrowserBehaviour.h"

void UFileBrowserBehaviour::SelectFile(FString NewFileName)
{
    if (FileName != NewFileName)
    {
        FileName = NewFileName;
        RefreshFileName.Broadcast();
    }
}

Thanks, i’ll try it now

Thank you very much, it works perfectly ! )))))