UFUNCTION(BlueprintPure, meta = (FriendlyName = "Get My Stuff"), Category = "MyCategory")
static void GetMyStuff(FMyStruct FilterData, TArray<TEnumAsByte<EMyEnum>> Filters, bool& ReturnValue);
I get compile errors when I don’t pass in an array, and I am wanting to make the underlined parameters be optional. I am currently doing this in order to work-around the problem:
You need to provide a default value (which could be null), and make it your last argument, or provide an overloaded version of the function that omits that argument.
I’ve seen the AutoCreateRefTerm specifier used for the purpose of making array parameters optional. Documentation is pretty lacking but it appears to create an empty array if the pin is not hooked up. Your function declaration would change to
I’m unable to reproduce a crash in either 4.9 or 4.10. Which engine version are you using, and can you show how the enumeration used in the array is declared?
The idea is good but from my experience in practice doesn’t work as long as the function name is the same. If I remember correctly UnrealHeaderTool will complain about it and not even start compiling. Possibly because functions are mapped only by their name which would be ambiguous.