Hello, as the title says, in my code i’m generating a number of prefabs, and adding them the trail renderer component, and setting all of it’s parameters like startwidth and so on, is ok, but for some reason, i can’t apply a material to the trail renderer itself.
so the trail keeps on rendering with the “missing shader” magenta color.
I tried this way
var trailcomponent = newplanet.GetComponent("TrailRenderer") as TrailRenderer;
trailcomponent.renderer.material = dummy_mat;
//or...
trailcomponent.renderer.materials[0] = dummy_mat;
none worked.
If i hadn’t randomly generated content, i could make a “trail prefab” and apply it, but it’s not my case. I need it to be added, and tweaked by code for each object.
thank you for your time ![]()