Player controller not possesing after swapping

Hello guys.

I am doing a character selection screen and i want the character selected to be spawn and possessed in the next map, i have been reading all over the forums and I do not know what I am doing wrong. Hope you guys can help me.

NOTE: The character selection screen and the gameplay map have different game modes and different player controllers and also, the seamless travel (in both game modes) is enabled.

Here is the config of my game modes:

This is the character selection screen gamemode

210760-character-s-game-mode.png

This is the gameplay gamemode

210759-main-game-mode.png

-------------- HERE IS THE DESCRIPTION OF THE PROBLEM -------------------------------

My problem occurs when, in the server, i execute the command ServerTravel [map name]. Like shown in this image.

210758-travel.png

Now, when the travel finishes, i have the OnSwapPlayerController event in the game mode. In which I use the old player controller as a reference to get the class, in order to spawn an actor, and possess it by the new player controller like so:

The result is that, the travels goes allright, the selected character gets spawned but, it is not possessed by the new PC, the map default pawn is the one that gets possessed.

Well, in the end, that part of the code was being executed but then, the gamemode will override the pawn created and put the one in the definition.

To solve that, i just removed the pawn class from the game mode and call the event “spawn and possess” in the begin play of the player controller.