UFUNCTION metadata "ExpandEnumAsExecs" and "Latent" interrupt each other?

Using 4.20.3

While coding in my** Game Instance** class and exposing functions to blueprint I encountered the following…

No matter what i do when assigning “ExpandEnumAsExecs” and “Latent” metadate to UFUNCTION the execution pins not firing.

Is that a feature or a bug?

My function declaration:

They are firing when I use this:


    
UFUNCTION(BlueprintCallable, Category = "MyFunctions", meta = (ToolTip = "MyToolTip", ExpandEnumAsExecs = "Branches"))
        void MyFunction(bool bSomeVar, int32 AnotherVar, EStatusEnum& Branches);


They are NOT firing when I use this:


    
UFUNCTION(BlueprintCallable, Category = "MyFunctions", meta = (ToolTip = "MyToolTip", ExpandEnumAsExecs = "Branches", Latent))
        void MyFunction(bool bSomeVar, int32 AnotherVar, EStatusEnum& Branches);


My EStatusEnum is:



UENUM(BlueprintType)
enum class EStatusEnum : uint8
{
    OnSuccess,
    OnFail
};


Help will be appreciated, thanks.

Had same issue, but found out I added forward-declaration of enum. Declaring enum before function solved this.

I wasn’t sure that should even work, but found a few engine examples so that’s pretty amazing.

I think what you’re missing is some additional markup and a function param.

UFUNCTION( BlueprintCallable, meta = (Latent, LatentInfo = ActionInfo, WorldContext = WorldContextObject, DisplayName = "Finish Visualization") 
void FinishVisualization_BP( UObject* WorldContextObject, FLatentActionInfo ActionInfo, bool WaitOnChildVisualizations = true );

Notice the LatentInfo meta-property and the FLatentActionInfo function parameter. You’ll probably need the WorldContext parameter as well. There’s a bit more setup required to get a working latent node than just marking it up.

hey, can you provide a sample code of the function how to use the FLatentActionInfo ActionInfo struct? it is quite an interesting stuff, I was able to create latent Bp nodes only by callbackproxy

Creating Latent Functions for Blueprints in C++

1 Like