- Home /
 
               Question by 
               chandrazack · Mar 24 at 08:47 AM · 
                c#unity 2dline renderer  
              
 
              customize line renderer from middle

Hi, i was made a line drawing but I have a question can I customize the size of the middle line like this but in code? thanks any help will be appreciated
here's my code
 void AddAPoint(Vector2 pointPos)
 {
     currentLineRenderer.positionCount++;
     int positionIndex = currentLineRenderer.positionCount - 1;
     int midPositionIndex1 = (currentLineRenderer.positionCount - 1) / 3;
     int midPositionIndex2 = (currentLineRenderer.positionCount - 1) / 3 * 2;
     currentLineRenderer.SetPosition(positionIndex, pointPos);
     Debug.Log("Mid line 1 = " + currentLineRenderer.GetPosition(midPositionIndex1));
     Debug.Log("Mid line 2 = " + currentLineRenderer.GetPosition(midPositionIndex2));
     currentLineRenderer.SetWidth(0.2f, 0.2f);
 }
 
                 
                screen-shot-2022-03-24-at-154309.png 
                (230.2 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
               
 
			 
                