- Home /
 
 
               Question by 
               Aydan · Dec 15, 2011 at 03:00 AM · 
                arraydebug.drawline  
              
 
              How do I Debug.DrawLine through an array of Vector3?
Hello I have an array of Vector3's and I was wondering is there some way of using Debug.DrawLine to draw a line in the editor through all the Vector3's? For example the line goes from the array[0] to array[1] to array[2] and so on.
Thanks.
               Comment
              
 
               
              Hey Aydan - there is no apostrophe in Vector3s .. it is just a plural !
 
               Best Answer 
              
 
              Answer by aldonaletto · Dec 15, 2011 at 03:23 AM
You could use a for loop:
for (var i=1; i<array.length; i++){
  Debug.DrawLine(array[i-1], array[i], Color.red);
}
 
              Your answer