why should a c++ "BlueprintImplementEvent” function in an interface use enum param directly?

I’ve metioned this wiered error during compiling an interface:



class  IINTERFACE_ANIM_BP_CREATURE_BASE
{
    GENERATED_BODY()

public:
    UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
    void Set_Strong_Control_Type(some_enum Val);
};

This passed compile, while


    UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
    void Set_Strong_Control_Type(TEnumAsByte<some_enum> Val);

can’t pass and throws a ‘No overrided member function found’ error.

I’m just curious about the error. Any idea guys?~ :slight_smile:

EnumAsByte, namespaced enums, are legacy engine architecture.

Why exactly they cause an error there I don’t know, never tried that.
btw should be passed something like
TEnumAsByte<some_enum::Type> there.

Thx for reply~ I’ll try it later on :slight_smile:

Nope it’s not working. I think it’s better just use enum then~

It doesn’t seem like good practice to put functions “of this type” in interfaces.

Also, if you are going to use interfaces in C++, mixing them with Blueprints (UFUNCTIONS (whatever you want)) you are tightly linking Blueprints and C++, which makes decoupling impossible and evidently breaks the functionality of an interface, which is to define a contract.

In plain words, if you use C++, do not use UFUNCTIONS and use virtual, only for C++ code. (By the way, if you have UFUNCTIONS and virtual, I don’t think VS warns you about the error. Rider does).

If you make a mix between them, you are breaking the purpose of an interface.