x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Keep pawn through different levels [Solved]

Hi,

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

The first blueprint : will, when I press the Y key, possess another character -> PersoBleu

alt text

The second blueprint : When I possess PersoBleu and press the P key, I will open the level named "level1"

alt text

And finally the third blueprint "MyGame" :Will set the 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"

Product Version: Not Selected
Tags:
ypersobleu.png (91.3 kB)
popenlevel.png (26.0 kB)
more ▼

asked Aug 20 '14 at 10:27 AM in Blueprint Scripting

avatar image

Styla-rox
38 3 7 7

avatar image Styla-rox Aug 20 '14 at 08:48 PM

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

avatar image Ben Halliday STAFF Aug 20 '14 at 10:12 PM

Hey Jonathan,

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

avatar image Styla-rox Aug 21 '14 at 08:45 AM

Hi ben, 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 the same for the two levels) :

alt text

And here the blueprint of MyGame :

alt text

gamemode.png (11.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Jonathan,

You need to move the Set Default Pawn Class to the Construction Script. The way you have it now, it changes the Default Pawn Class after the game has already started and the Player Controller has already possessed the Default Pawn Class before it can be updated. If you put this in the 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!

more ▼

answered Aug 21 '14 at 03:22 PM

avatar image Styla-rox Aug 21 '14 at 03:58 PM

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

avatar image Styla-rox Aug 21 '14 at 04:45 PM

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

avatar image Ben Halliday STAFF Aug 21 '14 at 07:45 PM

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

Yours might look something like this:

alt text

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question