This is going to be hard to explain since I don’t know the exact terminology.
I am making materials in the editor (dynamically) and applying them to generated mesh, but my problem comes when I want to turn my mesh into a prefab (with drag and drop into projects and with prefab utility),
I get the “No pixel shader pink” when I try and see the prefab.
This was my code:
obj.GetComponent<Renderer>().sharedMaterial = new Material(Shader.Find("SomeShaderIMade"));
I would like to keep that kind of format but I know you have to have some sort of material instanced, I have gotten it to work with using resources but it shares the material along all the objects and I need separate colors on them.
obj.GetComponent<Renderer>().sharedMaterial = Resources.Load("test") as Material;
Is there a way I can do this where I can bring in new materials and have my generated mesh produce correct prefabs?