UMediaPlayer cannot be a UPROPERTY?

Trying to place a pointer to a UMediaPlayer object in a class:

UPROPERTY(EditAnywhere, BlueprintReadOnly)
	UMediaPlayer* Clip;

… and it won’t compile. I get error C2144 and C4430 in my main project module.generated.h:

49>D:\projects\Intermediate\Build\Win64\UE4Editor\Inc\MyGame\MyGame.generated.2.cpp(35): error C2144: syntax error: 'UClass' should be preceded by ';'
49>D:\projects\Intermediate\Build\Win64\UE4Editor\Inc\MyGame\MyGame.generated.2.cpp(35): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

What gives here? Media player can’t be made a UPROPERTY?

It kind of look like compiler don’t know that is UMediaPlayer or something mess up in UHT generated code, did you tried rebuilding?

Yep, tried that. Still doesn’t compile.

Hey

Go to your [ProjectName].Build.cs and add “MediaAssets” to your PublicDependencies.

Cheers