Line renderer won't change color in-game.

Hi; I’m trying to get a line renderer effect in Unity. I have everything apart from the color change working. No matter what I do the line remains in the default purple.

Its fairly long but here is what I am using for the color change:

var c1 : Color = Color.white;
var c2 : Color = Color.white;
function Update ()
var lineRenderer : LineRenderer = GetComponent(LineRenderer);

//the color changes in the inspector for the line, but not the game
lineRenderer.SetColors(c1, c2);
lineRenderer.SetPosition(0, (transform.position));
lineRenderer.SetPosition(1, (hit.point));

If anyone has any ideas I would appreciate it.

I am a complete idiot; I missed out the line to establish a new material…

“lineRenderer.material = new Material (Shader.Find(“Particles/Additive”));” in the example.