Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Use tags, make title descriptive, format code correctly
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Line Renderer problem Draw LineRenderer gradually, rather than all at once

I'm trying to makedrawing a line with lineRenderer, I manageda LineRenderer. It works, but now I would like it the line to be drawn gradually, instead of goingappearing all at once... If anyone can help me I thank you!

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class LineController : MonoBehaviour {How can I modify my code to achieve this?

using System.Collections; using System.Collections.Generic; using UnityEngine; public class LineController : MonoBehaviour { private LineRenderer Ir;  private Transform [] points;  private void Awake(){   Ir = GetComponent <LineRenderer>();  }    public void SetUpLine (Transform[] points){   Ir.positionCount = points.Length;   this.points = points;  }  private void Update (){   for (int i = 0; i < points.Length; i++) {   Ir.SetPosition(i, points[i].position);   Debug.Log (points[i].position);   }  } } 

}`

Line Renderer problem

I'm trying to make a line with lineRenderer, I managed, but now I would like it to be gradually instead of going at once... If anyone can help me I thank you!

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class LineController : MonoBehaviour {

private LineRenderer Ir; private Transform [] points; private void Awake(){ Ir = GetComponent <LineRenderer>(); } public void SetUpLine (Transform[] points){ Ir.positionCount = points.Length; this.points = points; } private void Update (){ for (int i = 0; i < points.Length; i++) { Ir.SetPosition(i, points[i].position); Debug.Log (points[i].position); } } 

}`

Draw LineRenderer gradually, rather than all at once

I'm drawing a line with a LineRenderer. It works, but now I would like it the line to be drawn gradually, instead of appearing all at once.

How can I modify my code to achieve this?

using System.Collections; using System.Collections.Generic; using UnityEngine; public class LineController : MonoBehaviour { private LineRenderer Ir;  private Transform [] points;  private void Awake(){   Ir = GetComponent <LineRenderer>();  }    public void SetUpLine (Transform[] points){   Ir.positionCount = points.Length;   this.points = points;  }  private void Update (){   for (int i = 0; i < points.Length; i++) {   Ir.SetPosition(i, points[i].position);   Debug.Log (points[i].position);   }  } } 
Source Link

Line Renderer problem

I'm trying to make a line with lineRenderer, I managed, but now I would like it to be gradually instead of going at once... If anyone can help me I thank you!

using System.Collections; using System.Collections.Generic; using UnityEngine;

public class LineController : MonoBehaviour {

private LineRenderer Ir; private Transform [] points; private void Awake(){ Ir = GetComponent <LineRenderer>(); } public void SetUpLine (Transform[] points){ Ir.positionCount = points.Length; this.points = points; } private void Update (){ for (int i = 0; i < points.Length; i++) { Ir.SetPosition(i, points[i].position); Debug.Log (points[i].position); } } 

}`