Saving and loading a material via blueprints?

Hello all, I’m working on something where you can change the material of an actor from predefined options, save it and reload it. I’m trying to decide the best way to load the material chosen when you resume the game. I can’t just directly store the materials in the save game, because they are references. I could match them up with integers, like some kind of makeshift ID system and reload them that way, but that feels tedious and improper.

Is there an easier way of doing this? Any help would be appreciated greatly.

I’m afraid there is no really simple way to do this, but it is not that hard either.

You will have to use a save game, but there are a few Blueprint/C++ assets that you can use to make this a little more organised:

Structs: (It’s like grouping multiple variables in one)

Enumeration: (Assigning Names for your integers wich make them easier to read i.e. 0 means sleep, 1 walk etc.)

Data Assets: (This might fit best what you are describing, it’s a table of different variables and there values)

I was afraid of that. Fortunately, you reminded me of Enums! That’ll make the int to material system a little less painful to read, so thank you for that!

Thank you very much, was just making sure I was not overlooking anything.