TSubClassOf member variable is empty at constructor runtime

I have successfully used TSubClassOf declarations before, however this time it is not working. Possibly because I need to access it to spawn my member property in the constructor. My current situation:


TSubclassOf<class UMapManager> MyMapManagerType = UMapManager::StaticClass();

class UMapManager* MyMapManager;

MyGameMode.cpp (in the constructor):

if (!MyMapManagerType)
	UE_LOG(LogTemp, Error, TEXT("ERROR, no MapManager is selected by current game mode!"));
	MyMapManager = NewObject<UMapManager>(this, *MyMapManagerType);
	UE_LOG(LogTemp, Warning, TEXT("Created Map Manager"));

Picture of the BP_MyGameMode initializing the MapManager type:


Note that I have now attempted to put the default base class in, and yet in runtime, MyMapManagerType is always null and I get the error method. Is there some other way I should be doing this?
The MapManager is a class that the GameMode uses to generate the map.

I think, it happens because CPP Gamemode generates earlier than UMapManagergets its UClass(if we talk about declaration in header) and you see nullptr.
When you set MyMapManagerType in blueprint, you also do it at “construction” time of BP, CPP constructor runs first and because of that you get nullptr at the time when check is it valid.