So basicly, i want to draw a rectangle with lines.
I have 2 sets of objects being spawned, and i want a line around them, but much rather a big rectangle around the area they can spawn in.
Right now i have this:
void DrawLine(Vector3 start, Vector3 end, float duration = 0.2f)
{
GameObject myLine = new GameObject();
myLine.transform.position = start;
myLine.AddComponent<LineRenderer>();
LineRenderer lr = myLine.GetComponent<LineRenderer>();
lr.material = new Material(Shader.Find("Particles/Alpha Blended Premultiply"));
lr.SetWidth(0.1f, 0.1f);
lr.SetPosition(0, start);
lr.SetPosition(1, end);
}
Which works ok, but for 1 rectangle you already need 4 lines of code, and you cant edit it that easliy, so my question is is there any way to do this but then in a rectangle?