Download

Pass information between levels

Hi everybody

Just a quick beginner question.

What is the right way to pass informations between levels, eg. player health or standing at a faction.

Thanks in advance.

The way i’m currently looking at is having a custom GameState class holding the variables.
I need to finish testing it, so i may be wrong.

edit: Hmm… Looks like using an Open Level node that my GameState might be resetting to default values, thou i have bAbsolute set to false.
So either this isn’t going to work, or something else is going on.

I think the PlayerController Blueprint persists between levels, so that may be the place to store information about your player like health or other stats. If that doesn’t work for what you need, you can also look into creating a SaveGame Blueprint and using that to save and load information for your game. I don’t think there’s documentation for that feature yet, but this might help you get started: Saving runtime variable changes via Blueprint - UE4 AnswerHub

I will look into it.

Thank you.