What's the proper equivalent of `TAssetSubclassOf<>` for interfaces?

I want to specify that when a certain UPROPERTY() is populated in Blueprints, it should be populated with the Asset ID for an Asset which is a Blueprint Class which implements a certain interface. (I’m declaring my interface as specified here, Interfaces in Unreal Engine | Unreal Engine 5.1 Documentation using both a UInterfaceName class and an IInterfaceName class.)

The way to do this when you want to constrain your UPROPERTY() to be populated with the Asset ID for an Asset which is a Blueprint Class which is the child of a certain class is:

TAssetSubclassOf<UClassName> PropertyName;

But when I try

TAssetSubclassOf<IInterfaceName> PropertyName;

the code doesn’t compile, and when I try

TAssetSubclassOf<UInterfaceName> PropertyName;

the dropdown of choices with which I populate the property is blank even though there are Blueprint Classes in my project which implement the interface.

Any advice? Thanks in advance!

Did you ever find a solution to this? I’m needing the same functionality and I’m getting ready to go engine diving and roll my own.

First of all use TSubclassOf insted of TAssetSubclassOf, blueprint is same valid class as C++ and it should be treated same as any other C++ class in C++, or else you gonna have compatibility issues with your C++ and blueprint classes and you will be making different features for each. In general don’t treat code as asset but as classes, that why you trying this kind of gymnastics now ;p

For classes implmenting interface try using

TScriptInterface<IInterfaceName>

Found a solution that worked for me in this thread: Is TSubclassOf<> possible with interfaces? - C++ Programming - Unreal Engine Forums .

Basically add “meta = (MustImplement = “MyInterfaceName”)” to the UPROPERTY macro of the property that needs to enumerate classes that implement a specific interface.