# Saving and loading a material via blueprints?

**URL:** <https://forums.unrealengine.com/t/saving-and-loading-a-material-via-blueprints/374548>\
**Category:** Rendering\
**Tags:** unreal-engine, saving, Blueprint, question\
**Created:** [October 26, 2016, 9:13pm UTC](https://forums.unrealengine.com/t/saving-and-loading-a-material-via-blueprints/374548 "2016-10-26T21:13:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_fd498a211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fd498a211](https://forums.unrealengine.com/u/anonymous_user_fd498a211)\
**Post date:** [October 26, 2016, 9:13pm UTC](https://forums.unrealengine.com/t/saving-and-loading-a-material-via-blueprints/374548/1 "2016-10-26T21:13:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [October 26, 2016, 9:23pm UTC](https://forums.unrealengine.com/t/saving-and-loading-a-material-via-blueprints/374548/2 "2016-10-26T21:23:21Z")

</div>

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)

> **[Struct Variables in Blueprints](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/)**
>
> Blueprint struct variables allow you to store different data types that contain related information together.

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

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

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

> **[Data Driven Gameplay Elements](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/DataDriven/)**
>
> Driving gameplay elements using externally stored data.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_fd498a211](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_fd498a211](https://forums.unrealengine.com/u/anonymous_user_fd498a211)\
**Post date:** [October 26, 2016, 9:27pm UTC](https://forums.unrealengine.com/t/saving-and-loading-a-material-via-blueprints/374548/3 "2016-10-26T21:27:10Z")

</div>

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.
