Hello there,
I need to read values inside my character-class in the exact moment a player disconnects from a multiplayer match.
Now AGameMode::Logout is a pretty handy function for getting the Player Controller. However I am having problems with accessing the pawn. I wrote the following:
void ASomGameMode::Logout(AController* Exiting)
{
ASomCharacter* SomChar = (ASomCharacter*)(Exiting->GetPawn());
if(SomChar)
//do some things
Super::Logout(Exiting);
}
The Logout-Function receives a valid Player Controller, but the controlled pawn of this PC always is NULL. Maybe the Pawn is destroyed before this function is called? Is there a way to do some things with the pawn before it gets logged off/ deleted?