How to read Pawn-values while player disconnect?

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?

If you learn how to brows API refrence you would easily find this ;]:

As doc suggest it destroys pawn in base implementation, override it to change that behavior

Hey ,

thank you for your response.

Actually I did search the docs in the Pawn and Actor Section. It didn’t occur to me to search in the PC-Section for something Pawn-related. But thanks, it works like a charm! Have a nice evening :slight_smile: