- Home /
LineRenderer Lines Have Inconsistent Widths
I'm trying to draw thin lines using LineRenderer and have run into a problem where identical lines are being rendered at variable widths with random lines picking up an extra row or two of fuzzy pixels, depending on the screen resolution or "scale" level in the editor. Is there anything I can do to consistently get identically sized lines?
Here's an example of what this effect looks like:
Clarification: this is using an orthographic camera and the LineRenderers have every shadow and lighting option disabled, "View" Alignment, and are all positioned on the same plane.
Answer by ElijahShadbolt · Feb 17, 2018 at 05:30 AM
Pixel-perfect precision is very hard to achieve. There is an old script DrawLine which uses the legacy GUI to draw 2D vector lines, but I don't know if it is pixel perfect (or even if it still works).
Obviously if you set the 'scale' in the game window in the editor to something other than 1x, it will most likely never be pixel-perfect.
LineRenderer and any other mesh renderer in Unity is subject to the screen resolution and world scale of the camera, so if your lines are too small or far away from the camera, they sadly will not look identical to the naked eye.