In seamless travel, why are player controllers switched to spectator state ?
I'm working on a multiplayer game and I wanted to keep all controlled pawns when seamless traveling to new levels.
So I have added these pawns to the list of actors to be kept during seamless travel by overriding AGameModeBase::GetSeamlessTravelActorList
The actors were kept, but during the travel I was losing the connection between the player controller and their controlled pawns
Looking at the engine code, I saw this was coming from the AGameModeBase handling of the player controllers :
at the end of AGameModeBase::InitSeamlessTravelPlayer, we have this piece of code :
The new PC is switched to Spectating state, but I don't really get why
I could fix my problem by saving my controlled pawn in the PostSeamlessTravel method called right before, and setting it back after the travel by having the controller possess the pawn again.
I wonder if this is the intended mechanism, but I miss the point of this switch to spectating state and I'm looking for some insight
Follow this question
Once you sign in you will be able to subscribe for any updates here