1
\$\begingroup\$

I would like to expose some DataAsset in the configuration of my plugin.

If I wanted some integer, this would work well:

UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "Some asset")
int Foo;

But If I go for

UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "Some asset")
UFoo* Foo;

where

UCLASS()
class UFoo: public UDataAsset

then I get the error message:

error : Not allowed to use 'config' with object variables

Is there anyway to benefit from the nice UI features of UDataAsset, while exposing them in the settings?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

UObject pointers are not allowed to be used with Config. You should use FSoftObjectPath instead with the AllowedClasses metadata.

your property should look something like this:

UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "Some asset", meta=(AllowedClasses="DataAsset"))
FSoftObjectPath Foo;

Reference: https://forums.unrealengine.com/t/not-allowed-to-use-config-with-object-variables/492507/2

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .