Reputation: 47
I've seen several articles about this topic on here, but none of the solutions I saw worked for what I was doing. I'm trying to get a line to appear in the game in various colors and it works totally fine in the editor, but once I build it it turns pink, which from what I read means that the material wasn't built in with the rest of the game.
line.material.color = Color.yellow;
That's the way I'm coloring the lines now. Any suggestions on what to change/add? Thanks in advance!
Upvotes: 0
Views: 2348
Reputation: 1
It worked for me
Color Pink;
ColorUtility.TryParseHtmlString("#CA16B2", out Pink);
LineRender.startColor = Pink;
LineRender.endColor = Pink;
Upvotes: 0
Reputation: 371
Use a separate material and change material color using
lineMaterial.SetColor("_Color", Color.yellow);
See Screen Shot below:
Upvotes: 2