I want to get a variable from a blueprint class or a widget blueprint into my save game blueprint so how do I do that?
- Load SaveGame (its a blueprint function has a name like that). If that fails because it doesnt exist yet, use Create Savegame instead.
- Set a variable MySave (or whatever you want) as the return value from that function.
- If you created, it will have all its SaveGae object members set to the defaults you defined in your savegame class. If Loaded it will contain the values that were last saved to the file it came from.
- pull a wire from the right side of your MySave variable and you can Get any of the savegame members’ values, and use those to set values in your pawn, gameinstance, level blueprint, or wherever you want.
Make sure to call the Save Game node using your MySave object whe you want to write over/create the stored savegame file.
Can you give me an example, Thank you.
sorry i cant, but Mathew Wadstein has some Youtube videos about how to use the saveGame object
just look up “ue4 WTF is Gamesave” and it should be in the results. He gives very good video examples that are short and easy to understand how to use them.
Thanks it helped a lot