Restrict FStringAssetReference to Level assets only

I am using the following variable to set a reference to a Level asset in the editor.

UPROPERTY(EditDefaultsOnly, Category = "Maps") FStringAssetReference Mission10;

This works but the drop down list all assets in the project. I would like to restrict it to a list of level assets only. I tried the following:

UPROPERTY(EditDefaultsOnly, Category = "Maps", meta = (MetaClass = "Level")) and UPROPERTY(EditDefaultsOnly, Category = "Maps", meta = (AllowedClasses = "Level"))

But neither of these seem to be working. The list shows either everything or nothing at all. What specifiers do I need to use?

Use a TAssetPtr<UWorld> (or TSoftObjectPtr in 4.18) instead. This is a typed wrapper around FStringAssetReference.

FStringAssetReference (FSoftObjectPath since 4.18) will also work, “World” label does the magic trick :wink:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Content, meta = (AllowedClasses = "World"))
		TArray<FSoftObjectPath> Levels;