# Load Material from file path or parse .mat file to Material - Unity

Is it possible to load a material from a file path? Or, otherwise parse a .mat file saved on disk to a Material usable at runtime?

I had naively thought it would be possible to assign the bytes from a .mat file, as read by File.ReadAllBytes to a Material object, but that does not seem to work.

• Loading assets from files at runtime is what asset bundles used to be for and which you should now do with addressables. Unfortunately asset bundles are deprecated and I don't have enough experience with addressables to feel confident to write a proper answer. Oct 30, 2020 at 8:50
• However, this seems kind of like an XY problem to me. Can you tell us more about why you want to load a material at runtime from a path and not just import it into your project and assign it in the Unity editor? Oct 30, 2020 at 9:05
• @Philipp think millions of materials already on a server etc
– ina
Oct 30, 2020 at 17:32
• can't get addressable to work with assets from an external project, for other projects to use, unfortunately gamedev.stackexchange.com/questions/186472/…
– ina
Oct 30, 2020 at 17:33
• Why would you load millions of materials from a server? Are you talking about user-generated content? How much do you really want the users to be able to customize? Oct 30, 2020 at 21:25