Can't select Actor in custom Data Asset

I have a class that extends UDataAsset that includes an AActor* property. It compiles fine, and I can see the property when I’m editing an asset of my custom type. The problem is that when I try and select an actor as a value, the field stays at None. I have tried selecting an Actor from the dropdown, and also using the dropper to select an Actor from the scene and neither works. I’ve tried using both class AActor* ... and TSubclassOf in my C++ class and neither seems to make a difference.

Here’s the class header, I did not include the FDialogLines as it’s simply a struct with a few fields and irrelevant to this issue:

UCLASS(BlueprintType)
class URHDialogScript : public UDataAsset
{
	GENERATED_BODY()

	int32 LineNum;

public:
	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = DialogLine)
	class AActor* PrimaryActor;

	UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = DialogScript)
	TArray<FDialogLine> DialogLines;

	UFUNCTION(BlueprintCallable, Category = DialogScript)
	bool IsAtLastLine();

	UFUNCTION(BlueprintCallable, Category = DialogScript)
	void Reset();

	UFUNCTION(BlueprintCallable, Category = DialogScript)
	FDialogLine Next();

};

A few screenshots showing the issue in the editor.


Well, if I change it to use a UObject instead of UDataAsset and I create the type as a Blueprint instead of an asset it lets me select an Actor. But, not sure if that’s ideal. I guess I’ll experiment with this for now.

I would like to see a solution for this too where you can keep the UDataAsset inheritance, although I can see problems with this since an actor can be transient and saving it to disk using a pointer can be fraught with problems.