I overrode AGameMode::Login in my custom game mode. I found a call to SetInitialLocationAndRotation in this method that seemed to set the initial location and rotation of the player based on the StartSpot. When I step through the code below, which is in AGameMode::Login, I can see the correct values being sent into SetInitialLocationAndRotation, but yet the game still loads the player at the StartSpot instead of the persistent location I am loading from the SQL database. Is AGameMode::Login not the correct place to set the initial player location and rotation?
int32 CreatureID = 0;
IDBInventorySystemPlugin::Get().GetCreatureIDFromUserName(InName, CreatureID, DBConnectionString);
if (CreatureID == 0)
{
ErrorMessage = FString::Printf(TEXT("Failed to find UserName"));
return NULL;
}
FTransform *CreaturePosition = new FTransform();
IDBInventorySystemPlugin::Get().GetPlayerPosition(CreatureID, (*CreaturePosition), DBConnectionString);
NewPlayerController->SetInitialLocationAndRotation(CreaturePosition->GetTranslation(), CreaturePosition->GetRotation().Rotator());
//NewPlayerController->StartSpot = StartSpot;