Currently I am using GL.Lines to create a kind of sonar vision. Unfortunately I can’t seem to change the color of the lines, I think I am doing something wrong here but I don’t know where. Having a single red sonar works, but when having a red and white one at the same time, all the sonar turns to white.
GL.Begin(GL.LINES);
for (int ii = 0; ii < lines.Count; ii++) {
LineOfSight l = lines[ii];
l.lineMat.SetPass(0);
GL.Color(l.colour);
for (int i = l.vertices.Count - 1; i > 0; i--) {
GL.Vertex(l.vertices[i - 1]);
GL.Vertex(l.vertices*);*
-
}* -
}* -
Debug.Log(lines.Count);* -
GL.End();*
Worked like a charm! Used this http://wiki.unity3d.com/index.php/VertexColorUnlit
– akirassasin_dev