For some reason I can’t declare variables as UPROPERTY in class that I want to be able to access from a Blueprint. Compilation will fail with the error “Missing ; in variable declaration” right after the variable definition in the header file. I don’t know why this would be the case, as I copied the UPROPERTY specifier from a character class which compiles fine with the same specifier. Here is the partial header file:
#pragma once
#include "GameFramework/Actor.h"
#include "GeneratedMeshComponent.h"
// #include "RandomTerrain.h"
#include "GameGeneratedActor.generated.h"
/**
*
*/
UCLASS()
class MYPROJECT_API AGameGeneratedActor : public AActor
{
GENERATED_UCLASS_BODY()
// uncommenting the UPROPERTY cause a compiler error "missing ; in variable declaration"
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
int32 NumTilesXY = 63;
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
float TileSize = 100.f;
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
int32 NumHills = 10;
// UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TerrainGeneration)
int32 NumValleys = 10;