Keep pickups on hud

Hey I am working on a third person template project and have created some blueprint class objects that are classed as my pickups such as coins. My question is is there a way to keep what you have created kept on hud from one level to another. As at moment i collect all my coins and then when I go into level 2 it goes back to zero. Could someone please help me by explaining this to me as to how to fix this please. Any help wuld be appreciated.

When you transition between levels, widgets get wiped (other things, too).

Save the information about what the player has collected so far in a Save Game Object (you’ll need save games eventually anyway, right?) or store it in the Game Instance blueprint (persistent throughout the game session), and recreate widgets once the new level loads.

  • create a struct that represents the collectible data
  • have this struct variable in the widget, exposed and editable
  • in the widget construct event, read the data off the struct and let the widget fill in the info based on that struct
  • when creating widgets, feed them the struct (from the save game or game instance)

You can have arrays of structs, too - representing multiple items. Loop through arrays and batch respawn the widgets.

That’s the gist.