Answer the question
In order to leave comments, you need to log in
How to create multiple lines from the same object with different colors?
To make it clearer what I mean, I will give an example of all kinds of research in games, from one research there are branches according to the type of what needs to be researched in order to open this or that research, so it turns out that those studies that are already open to them, for example, should have a red line, and those that are closed by a black line, I draw the lines themselves like this.
public LineRenderer lr;
....
lr.positionCount = 6;
lr.SetPosition(0, Position0);
lr.SetPosition(1, Position1);
lr.SetPosition(2, Position0);
lr.SetPosition(3, Position2);
lr.SetPosition(4, Position0);
lr.SetPosition(5, Position3);
lr.GetComponent<Renderer>().sharedMaterial.color = new Color(0f, 0f, 1f, 1f);
lr.startWidth = 0.075f;
lr.endWidth = 0.075f;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question