SetInitialLocationAndRotation in AGameMode::Login has no effect

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;

#SetInitialLocationAndRotation

This is a player controller function for the player controller itself, not for the character.

If you have a Character spawned and the PC is possessing it, the PC will quickly override/ignore setting its rotation and location, because it is using the camera functions of the Character every tick.

If your goal is to set character location and rotation, do so directly

Character->SetActorLocation()
Character->SetActorRotation()

:slight_smile:

Rama