James Hancock
asked on
Why does the Color of this Unity lineRenderer never change the line color?
Hi,
My Unity C# game needs just a few more graphical abilities.
I can generate lines, as needed, in code as such - this should show the key uses :
(towerNumber is an instance variable.)
......
line = (new GameObject("line"+ TowerNumber)).AddComponent<LineRenderer>();
line.startWidth = (float) 0.3;
line.endWidth = (float)0.3;
line.startColor = Color.yellow;
line.endColor = Color.blue;
Vector3[] positions = new Vector3[2];
positions[0] = new Vector3(0, 0, 0);
positions[1] = new Vector3(TowerNumber * 2, -1, 0);
line.SetPositions(positions);
If I change the start and end Widths in code, the line changes width,
but the color never changes (for start or end color) and I can't see why? It is always magenta - does that mean ERROR?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.