Cannot spawn blueprint cubes from c++

Hi, I’m pretty new to UE4 but I have been having an issue where I cannot spawn mesh cubes into the game. What I’ve done is create a blueprint based off of a c++ class and in the blueprint editor I gave it a cube mesh. The code I use to spawn the blocks is the following,
In my constructor:

	static ConstructorHelpers::FObjectFinder<UBlueprint> ItemBlueprint(TEXT("Blueprint'/Game/TopDownCPP/Blueprints/TerrainBlock.TerrainBlock'"));
	if (ItemBlueprint.Object)
	{
		TerrainBlockBlueprint = (UClass*)ItemBlueprint.Object->GeneratedClass;
	}

and then in my actual method:

void Main::Generate()
{
	UWorld* World = GetWorld();
	FVector fVector;
	FRotator fRotator = FRotator(0, 0, 0);
	if (World)
	{
		fVector = FVector(20, 100, 0);

		World->SpawnActor<AATerrainBlock>(TerrainBlockBlueprint, fVector, fRotator);
	}
} 

Just to test this out I called the Generate method from the GameMode constructor and I set a keybind to it and called the Generate method from the PlayerController. Neither worked unfortunately.

I actually figured it out, the issued was in the fact that the classes I made were into the project and not created via the unreal editor. When I made a new project and did it properly the placing worked.