
A 2D pixel-perfect line strip renderer for UnityDraw pixel-perfect 2D lines in the scene with any thickness and use them as if they were sprites. Lines are affected by layers, 2D lights, sorting layers and post-processing FXs. Add as many points as you need to create line strips and represent your ropes or cables, and update them every frame. Enable any of the visual effects available out of the box like dotted lines, textured lines, gradients, and more.Compatibility: Windows and Mac, all versions of Unity since 2020.3.0. Depends on the 2D Renderer (URP).Please visit https://linerenderer2d.com to see all features with animated examples.Fully integrated in the 2D URP scene, like a spriteAffected by 2D lights (can ignore lighting too).Each line renderer belongs to a sorting layer.Effects are applied per pixel distance, not per actual distanceStarting at one endpoint of the line, color patterns progress one pixel at a time towards the other endpoint.Thickness can behave in 2 different waysIt can be constant on the screen disregarding the orthogonal size of the camera.Or it can adapt to it.Reduced pixel vibration when moving the cameraThe camera's imaginary grid where the line is drawn does not exactly match the screen's grid, and the position of each point in the line does not coincide with the center of each cell in that grid either. That produces imprecisions when either points change their position or the camera moves.Adding some adjustments to the position of each point before drawing prevents that from happening and let us move lines smoothly, no matter their thickness.Editor preview of the lineYou can add, remove or move points of the line strip in the scene view, and see a preview of it, including its visual effects. It will not match the actual rendering of the line because it uses the editor's camera.Visual EffectsDotted linesYou can choose the length, in pixels, of the dots and the length of the space between them.An offset can be applied to achieve interesting effects.When dotted lines use textures, colors are applied to each dot, in order, no matter the dot length.Textured linesDefine color sequences that will repeat along the entire line strip, starting at one endpoint.Color sequences can be stored in textures.Color gradientsLines can be colored using a 2-colors gradient whose length and starting position can be defined as desired. Texture and gradient colors are mixed.Enable the adaptive gradient length if you want the color gradient to extend along the line regardless of its length.Bounds offsetA line strip is defined by a set of points, but you can choose at which pixel the line starts and how many pixels will be drawn from there.Changing the start point may affect the offset of the other visual effects, optionally.Overlay textureA texture can be projected on the line. The position of the texture does not depend on the position of the line. This can be used to achieve the effect of a laser ray that goes through the smoke of a room, for example.