I have a class in C++ that I want to access in BP. It appears to be fine in C++ but in BP I get Accessed None
errors when I try to use it in BP. Here is the class declaration that I am trying to use in BP
UCLASS(BlueprintType)
class ZOMBIEHORDE_API UQualitySettings : public UObject
{
GENERATED_BODY()
public:
// constructors
UQualitySettings();
// class functions and properties
};
I am holding on to it in the GameInstance
as below so I can access it through the GameInstance
reference.
CLASS(Blueprintable)
class ZOMBIEHORDE_API UZombieHordeGameInstance : public UGameInstance
{
GENERATED_BODY()
public:
UZombieHordeGameInstance();
UPROPERTY(BlueprintReadOnly, Category = "Zombie Game Instance")
UQualitySettings *QualitySettings = nullptr;
};
And GameInstance
.cpp
UZombieHordeGameInstance::UZombieHordeGameInstance()
{
QualitySettings = NewObject<UQualitySettings>();
ensure(QualitySettings);// this passes and does not throw an error
}
This shows how I am accessing it in a widget blueprint.
So how can it be that accessing QualitySettings
in BP is None
?