I found a solution for my problem… i guess its the same then yours. In my gamemode BP i want to store in the “OnLogout” several informations of the player pawn, like position, but the pawn is already destroyed in the “OnLogout” by the Unpossess’ing.
So i didnt found a way in BP honestly… my solution for it is to overwrite the UnPossess() of my custom class C_PlayerController and override the “UnPossess()” method to store stuff from the Pawn before it gets unpossessed further. In BP i then just use the value of my storeage variable “unpossessPawnTransform”.
The Header part:
UCLASS()
class CLIENTSERVERTEST_API AC_PlayerController : public APlayerController
{
GENERATED_BODY()
public:
/** Stores the transformation of the unpossessed pawn */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=PlayerController)
FTransform unpossessPawnTransform;
virtual void UnPossess() override;
};
The CPP part:
void AC_PlayerController::UnPossess()
{
UE_LOG(LogTemp, Warning, TEXT("UnPossess()"));
if(this->GetPawn() != NULL)
{
UE_LOG(LogTemp, Warning, TEXT("UnPossess() i got some pawn"));
this->unpossessPawnTransform = this->GetPawn()->GetActorTransform();
this->unpossessPawnTransform.DebugPrint();
}
else
{
UE_LOG(LogTemp, Warning, TEXT("UnPossess() dont have a pawn here too, wtf"));
}
APlayerController::UnPossess();
}
On my gamemode BP it looks like this then: