Linerenderer positions from Transform

i tried to a modify a script from the forum to get the Linerenderers positions from Transforms but get an error when compiling:

// the options
var startWidth = 0.05;
var endWidth = 0.05;
var aMaterial : Material;



// these are set in start
private var line : LineRenderer;

var point01 : Transform;
var point02 : Transform;
var point03 : Transform;
var point04 : Transform;
var point05 : Transform;
 

function Start ()
{
   line = this.gameObject.AddComponent(LineRenderer);
   line.SetWidth(startWidth, endWidth);
   line.SetVertexCount(5);
   line.material = aMaterial;
   //line.renderer.enabled = true;
}

function Update ()
{
   line.SetPosition(0, point01);
   line.SetPosition(1, point02);
   line.SetPosition(2, point03);
   line.SetPosition(3, point04);
   line.SetPosition(4, point05);
}

how can i get the point positions from transforms or gameobjects ?

The SetPosition function doesn’t want a Transform object. It wants a Vector3 (a position). The fix is really easy.

Instead of

line.SetPosition(0, point01);

use

line.SetPosition(0, point01.position);

If you do that for all the SetPosition calls, it should work great.

thanks a lot,now it works