I just recreated a brand new trivial project to illustrate the problem. There are two classes as follows.
UCLASS()
class TESTING_API UMyObject : public UObject
{
GENERATED_BODY()
};
and
UCLASS()
class TESTING_API AMyActor : public AActor
{
GENERATED_BODY()
private:
UPROPERTY(VisibleAnywhere)
class UMyObject* MyObjectVar;
};
AMyActor::AMyActor()
{
MyObjectVar = NewObject<UMyObject>(this, UMyObject::StaticClass(), TEXT("MyObjectVar"));
}
I dragged the actor class itself UMyActor
(not the blueprint class of UMyActor
) onto the level and attempted to save. Unfortunately, UE shows the following error.
Note that this problem only occurs if there is an instance of UMyActor
on the level. More precisely, instances of the blueprint class of UMyActor
do not cause any problem. The instance of UMyActor
is the culprit as far as I know.
Question: What am I missing here?