Keep pawn through different levels [Solved]

Hi,

I got a problem trying to keep “default pawn settings” through two different levels.
Here is some Screenshots to better understand my problem.

first blueprint : will, when I press Y key, possess another character → PersoBleu

second blueprint : When I possess PersoBleu and press P key, I will open level named “level1”

13235-popenlevel.png

And finally third blueprint “MyGame” :Will set default pawn character to “PersoBleu”

“Event begin” play linked to “Set default pawn class : PersoBleu”

So I dont understand why, when I open “level1” I spawn with a different character then “PersoBleu”

Still looking for an answer, or at least something to guide me throught

Hey Jonathan,

What Game Mode is level1 using? You might need to open that level separately and make sure Game Mode is set to MyGame.

Hi , thanks for your reply,

level1 is using MyGame so thats why I dont understand.

Here are some more screenschot to see if ive done a mistake somewhere :

Gamemode ( exactly same for two levels) :

13328-gamemode.png

And here blueprint of MyGame :

Hey Jonathan,

You need to move Set Default Pawn Class to Construction Script. way you have it now, it changes Default Pawn Class after game has already started and Player Controller has already possessed Default Pawn Class before it can be updated. If you put this in Construction Script, it happens before play begins, so your Controller will have a new Default Pawn Class to refer to when it looks for something to possess.

Hope that helps!

God dame sake, thank you very much, problem solved !

sry to add a new comment but Ive got a new question (curiosity). What about if I whant to store value of a pawn on “level1” and then call value of pawn stored on “level1” to use it on “level2” ?

You’ll need to look into SaveGame Blueprints and saving variables between levels. If you load a SaveGame Blueprint in Construction Script and grab a variable of type Pawn Class, you can then pass that to Set Default Pawn Class node.

Yours might look something like this:

There are a number of tutorials out there that get into saving and loading, if you’re not already familiar with that. You can also reference this AnswerHub post that I answered earlier today, which would show you a working example of how saving a variable and loading it in another map might work. If you run into more questions about that, please feel free to open another post with your questions and reference this post, and we’ll get into it there. Thanks!