- Home /
Procedural Mesh/UV
Hi, I'm trying to create a LineRenderer type of line but with a "stretch/squeeze in the middle" setting, and got a strange uv behavior. Code looks like this if you drag it from loopuv[0] = new Vector2(0, 0);
uv[1] = new Vector2(0, 1);
uv[2] = new Vector2(1, 0);
uv[3] = new Vector2(1, 1);
uv[4] = new Vector2(2, 0);
uv[5] = new Vector2(2, 1);
Overall, looks like the line is twisting.
It depends how your vertices are ordered, but I don't see why you would want to stretch the uv with values over 1 if the vertices already take care of that. I scribbled your uv layout on paper and it's like two triangles where the second one is offset by 1 on the x axis. Try decreasing the x values of the second triangle by 1.
Your answer
![](https://koobas.hobune.stream/wayback/20220612095004im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Easy way to convert a bunch of vertices to triangles or uv's? 1 Answer
How do I go about texturing a flat-shaded generated mesh? 1 Answer
Applying UV to plane mesh is pixel imperfect. 0 Answers
Check if a mesh has UV map at runtime 1 Answer
repeating textures on procedurally generated plane mesh 2 Answers