Cant save the player controller in Game Instance

I make a Local Multiplayer like this Blueprint Implementing Local Multiplayer | Live Training | Unreal Engine - YouTube .
In every mapchange I lost the player on his controller. And I cant save the Player Controller in a Game Instance. This Instance work fine with other variables, but not with Player Controllers. Is there a trick or any other way to keep the player by changing the map?

Edit: I want to keep the inputhardware of every Player. for exampe: Player 0 play the keyboard, Player 1 with gamepad 2 and Player 2 with gamepad 1

I’m not 100% sure if you’re speaking only to local mp or networked, but for local can use this tutorial as a good guide to setup possession to always be on a specific controller. https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/PossessPawns/Blueprints/

Thank you for your time. I know this tutorial but it dont help me. My Problem is the gameinstance dont keep or save the inputdevice of the players. If I search a resolve I found many guys with this problem, but no good solution. I avoid this problem with working levelinstance. The Mainmenue and every map is one level and i change the environments only by using another level instance, but not open a New level. So i keep EVERYTHING i want from Start till End.

Have you tried creating a custom structure and adding the player controllers to it to be stored as variables in that fashion? I’m mocking up a test for it right now to see if it would work, but that’s one of the possible solutions that hit me when I read your post again. Sorry I didn’t fully touch on the core problem to begin with.

It’s OK. Sure I did. But after loading another map there is no player controller in the gameinstance, save everything, but not the Player Controllers. I will rebuild this Problem today and post some Screenshots.

Pressing the button to spawn a character, works fine

All happens in the gamemode and it cast to gameinstance the PlayerControllers, works fine too

I change the map and the gameinstance dont keep/save the PlayerControllers

I want to keep every Player with his own Inputdevice (Gamepad or mouse or whatever) on every new map without press a button again and again. Only at the Gamestart every player must pess a button. But the Instance dont save this. Iam not sure PlayerController is the right to make this.

Did you solve this, I would love to know how to.

No, I never got the problem solved, I think it’s not possible. In my case, I have just run everything in a map and just uploaded levelinstances. but there are certainly other ways to use.
For example, you can include a “ready button” where each player must press a button to be “ready”.

I know it’s quite an old post, but I encountered the same problem and investigated a bit. Here is what I found:

The problem arises when you save your PlayerController in the game instance; it stores the reference, not the data. So when you switch levels, the reference is lost, and the saved data are also lost. I tried everything, but there seems to be no way to store a copy of the player controller data. My workaround is to create a struct with string, bool, and int variables and copy over the data I need to store for the next level. Another workaround is to use “OnSwapPlayerControllers” in the GameMode. This event gets triggered every time you switch levels (via ServerTravel), and it provides access to both the old player controller and the new player controller. Here, you can access the old player controller and forward your stored data to the next level. This way, you can always bring your player controller data to the next level an infinite number of times.

There is another way as well; you can use “playerstat” to store the information you’d like to keep and then save it in the game instance. I’ll give it a try and update this post if it works well for me.

I hope this helps you all in the future. :slightly_smiling_face: