Can anybody give a example on the ussage of the LineRenderer which would get me started. Ifound this from liquidgraph
/ the options
var startWidth = 0.05;
var endWidth = 0.05;
var aMaterial : Material;
// these are set in start
private var line : LineRenderer;
private var point01 = Vector3(0,0,0);
private var point02 = Vector3(0,0,0);
private var point03 = Vector3(0,0,0);
private var point04 = Vector3(0,0,0);
private var point05 = Vector3(0,0,0);
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);
}
it’s setting four points ergo drawing a retangle.
How can i use the coordinates from other (moving) objects and give them to the line renderer ???
And can the line be not straith, can it be a curve ?
Thanks for any Help or Ideas