Download

Does an array of pawn class have issues with SaveGames?

I noticed in my project that when I do something that saves the game, my array of pawns of class gets reseted, heck, even if it’s from stuff that doesn’t involve saving this specific array, just having something that creates the savegame makes it reset.

In my game, I have a store where the player can buy new cars (add to the array of pawns of class reference and to the savegame version of this variable), and then can select them at his house.

Is the array saved to the save file?

In the stuff I need it, yes.

In a group, one told me about the Game Instance, but as far as i’ve saw on tutorials, it appears to be used mostly just for transfering state of things from one level to another without saving.

A little update, it definitely appears to be a bug, even when I tried in a new project, and a third person one, even just with triggers and no UMG, the problem persists.

EDIT: I made a “fix”

I had to cast the player controller and get the array + the Save Game one, for each actor that can save in order to maintain the stuff.