- Home /
Question by
Greep · Sep 19, 2014 at 01:57 PM ·
line renderertrianglesquare
Warped lines with line renderer
Hi, I'm trying to draw just a very simple square for a 2d game using line renderer in unity, but it's coming out horribly warped. That is, one line segment is a nice looking thin rectangle, while the others look like a triangle getting thinner to the next point. I'm using these coordinates:
line.SetVertexCount (5);
line.SetWidth (.2f,.2f);
line.enabled = true;
line.SetPosition (0,new Vector3(x,y,0));
line.SetPosition (1,new Vector3(x + 1,y,0));
line.SetPosition (2,new Vector3(x + 1,y + 1,0));
line.SetPosition (3,new Vector3(x,y + 1,0));
line.SetPosition (4,new Vector3(x,y,0));
The only line that looks correct is the findal line connecting x,y+1 and x,y
Comment