Download

Keep player pawn when open level

Hey everybody !

I try to make a menu, where player can open a level. But I have a problem, player pawn change when I open the level.

We can see, in the menu, the player pawn is “MyCharacter_C_2”
ba9073ea3b7536a2132dea765988ef843f5aa9bc.png

I click on Career to open level, and when I check the player pawn : “MyCharacter_C_3”
6e38898cd157ca7a91316baae489a985f4892d47.jpeg

Here the “Career” button blueprint
66adef097a21a0d0c914bf0be2eebe2337e7a782.png

The GameMode is the same. ( default pawn = MyCharacter in Menu and in Example_Map ).

So, how can I save player pawn ?

Thank you :slight_smile:

As far as I know you can’t. I use a game instance to keep permanent values, which again - AFAIK - is the only (or at least best) way to have one blueprint persistent throughout your game.

You set your game instance class in ‘edit - project settings - maps and modes - game instance’. Keep an eye out for this pulldown to reset itself, it’ll do that if you rename your active game instance BP for instance and causes crashes if so on my end at least.

Hope that helped.

If you want to save data to disk later on, perhaps its better to already look into Save Games:

Since that also solves your problem of retaining data across levels. If thats what you’re going for, at least.

I also think you can keep your Pawn if you stream levels instead of opening them.

Thank you for answers, I used Game Instance and It works fine.