No ideas? Looking closer I’ve noticed a couple things:
• The last line segment of the line renderer displays normally.
• The lines are twisted even without using the script (new project shows this below).
• The twisted lines seem to have one triangle that rotates TOWARD the camera, as would be expected, but the other triangle rotates AWAY from the camera. Normals?
EDIT: A line segment “twists” more or less depending on the relative angle of the segment after it. Is this a ‘feature’?
The LineRenderer doesn’t try to mitre corners at all. The pair of vertices generated for a particular corner are placed perpendicular to the next segment of line, with no regard for the angle of the previous segment, so sharp turns can look pretty ugly.
There are a couple of options. You can either insert more vertices to turn the corner more smoothly, or you can use the Mesh API to write your own version of the LineRenderer with features to mitre corners properly.