Lord Baphelon
Lord Baphelon

Reputation: 47

Unity LineRenderer making line pink in built version of game

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

Answers (2)

alireza rastgoo
alireza rastgoo

Reputation: 1

It worked for me

Color Pink;
ColorUtility.TryParseHtmlString("#CA16B2", out Pink);
LineRender.startColor = Pink;
LineRender.endColor = Pink;

Upvotes: 0

gameDev_Unity
gameDev_Unity

Reputation: 371

Use a separate material and change material color using

lineMaterial.SetColor("_Color", Color.yellow);

See Screen Shot below:

enter image description here

Upvotes: 2

Related Questions