Create and save Material Instance from a Material

Hi, I am crating a Editor Utility Widget. I wanted to support automatic way to creating material instances of a material and then save them in same directory as Material. I was able to create Dynamic Material but could not figure out a way to save them.

I also tried using ‘Create Asset’ but could not figure out how to supply Material as ‘Target’ in Create Asset.

1 Like

Hey there @roguedeveloper! Welcome to the community! I believe the dynamic materials are meant to be used at runtime, but to solve your material instance woes, all you’ll have to do at the end where you casted to the material instance itself, would be to set it’s parent like this and it should derive from the material you want.

image

Let me know if that works out!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.