I have a class derived from a UObject defined like this
UCLASS()
class MYPROJECT_API UStatistics : public UObject
It has private members and public function to access these members. Every function is a UFUNCTION, so that I can call them inside the blueprint.
I have an instance of this class inside another class, defined as follow
UCLASS()
class MYPROJECT_API AFirstPlayer : public ACharacter
{
[...]
public:
UPROPERTY(BlueprintReadOnly)
UStatistics* Statistics;
}
In the costructor I initialize this variable as follow
Statistics = CreateDefaultSubobject<UStatistics>(TEXT("Statistics"));
I created a blueprint from my AFirstPlayer C++ class, but if in the event graph I try to use the Statistics variable, it says that it is invalid. What am I missing? Am I forced to setup an attachment for these variable?