.h
USTRUCT(BlueprintType)
struct FTestData
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
float TestValue;
};
UCLASS()
class FIXIKIVR_API ATestGameModeBase : public AGameModeBase
{
GENERATED_BODY()
public:
ATestGameModeBase();
void InitConfigValues();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Init)
FTestData TestData;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Init)
float TestFloat;
};
.cpp
ATestGameModeBase::ATestGameModeBase() : Super()
{
this->InitConfigValues();
this->TestFloat = 5;
}
this->InitConfigValues()
initializes TestData. If this is built and launched from VisualStudio it all works fine, but if the project is launched from Epic Games Launcher or by double-clicking .uproject file the TestFloat variable is missing, TestData is there but initialized with zeros and is in the wrong category.