SpawnActor() spawns invisible actor c++ UE4

I tried to spawn BP class from C++. My code is here:

TSubclassOf<class AWall> wallClass;

 UMazeLib::UMazeLib() {
    static ConstructorHelpers::FObjectFinder<UBlueprint> wallBP(TEXT("Blueprint'/Game/BP_Wall.BP_Wall'"));
	if (wallBP.Object) {
		wallClass = (UClass*)wallBP.Object->GeneratedClass;
	}
}

void UMazeLib::spawnMaze(int size, UWorld* world) {

	bool** maze = generateMaze(size);
	for (int h = 0; h < size; h++)
	{
		for (int w = 0; w < size; w++)
		{
			if (maze[h][w]) {
				int x = h * 100;
				int y = w * 100;
				const FVector* position = new FVector(x, y, 0);
				AActor* spawnedWall = world->SpawnActor(wallClass, position);
				spawnedWall->SetActorHiddenInGame(false);
			}
		}
	}
}

But it spawns actor invisible, and after I return from play mode to editor, they shows me.

Solved! I used my asset map in BP instead of GetWorld();

Can u help comment more about your solution ? Thanks

My problem was that I spawned C++ class instead of BP. C++ class did not have the mesh or it was just not set.