How can I create and spawn an Actor class from code?

I’ve created a class through code that has a static mesh assigned and a material:

MyBlock = PCIP.CreateAbstractDefaultSubobject<UStaticMeshComponent>(this, TEXT("Wall_Ninty"));
static ConstructorHelpers::FObjectFinder<UStaticMesh>StaticMesh(TEXT("StaticMesh'/Game/Meshes/Environment/Ground/Wall_Ninty.Wall_Ninty'"));
static ConstructorHelpers::FObjectFinder<UMaterial>Material(TEXT("MaterialInstanceConstant'/Game/Meshes/Environment/Ground/TempGroundMat.TempGroundMat'"));
MyBlock->SetMaterial(0, Material.Object);

Then I have a Game Mode class where I want to spawn the actor class I created in code during BeginPlay()

void AGameMode_Maze::BeginPlay()
	UWorld* const World = GetWorld();
	if (World)
		ATestIcoCorner* TheWallNinty = World->SpawnActor<ATestIcoCorner>(ATestIcoCorner::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator);

I feel I’m missing a step. I found on another thread someone indicating I should create the actor class in code, then create a blueprint and make it the child of the c++ class in the editor, then create another class for the blueprint in code and use FObjectFinder to reference that BP. Finally in the Game Mode use the SpawnActor on the blueprint class which would spawn the BP?

Can I only spawn blueprints from code? Is there no way I can just spawn the class I created which already houses the static mesh and material?

Any direction would be greatly appreciated. I’ve been stuck on this one for awhile now,. Thanks!

Okay so it appears that in Edit->Project settings where one sets the maps & modes is overwritten by the world settings tab on the right in the editor. I had selected my game mode in the Edit->ProjectSettings-> Maps & Modes section but it was being selected in the world settings tab back to the other game mode…