Vectrocity VectorLine Method not Making Multiple Points Line With List
There are simple three gameobject in my scence so i want a line which cover all for this purpose i take three object
public GameObject coinSprite;
public GameObject AsteroidSprite;
public GameObject plankSprite;
After reading the doc there are two method available
private void MakeLineCustomSimple()
{
sl = VectorLine.SetLine(Color.green, coinSprite.transform.position, plankSprite.transform.position, AsteroidSprite.transform.position);
sl.smoothWidth = true;
sl.SetWidth(20f);
sl.Draw();
}
This work for me but when i try to do this by other method which is
private void MakeLineCustomFromList(Transform first,Transform second,Transform third)
{
listOfObjects = new List<Vector2>();
listOfObjects.Add(first.position);
listOfObjects.Add(second.position);
listOfObjects.Add(third.position);
lineWithListCustom = new VectorLine("dsd", listOfObjects, 0.3f);
lineWithListCustom.Draw();
}
I'm Using Vectrocity Version 5 on Unity3d 5 Its not working it just Show the points but draw line from two point line . From Point A to B just.
And also not visible in Camera View.
Answer by Cynikal · Nov 03, 2016 at 02:05 PM
It took some fooling around, but I got it to work.
Change your code to:
private void MakeLineCustomFromList(Transform first,Transform second,Transform third)
{
listOfObjects = new List<Vector2>();
listOfObjects.Add(first.position);
listOfObjects.Add(second.position);
listOfObjects.Add(second.position);
listOfObjects.Add(third.position);
//listOfObjects.Add(third.position); <--Uncomment to complete circuit.
//listOfObjects.Add(first.position); <--Uncomment to complete circuit.
lineWithListCustom = new VectorLine("dsd", listOfObjects, 0.3f);
lineWithListCustom.Draw();
}
Basically, think of it as Start and End Caps.
So, when you add 1st to 2nd, to 3rd...
1st (start cap) to 2nd (end cap) to third (start cap) ....no end cap..no line.
Still not showing in Camera View. In Editor It's Fine
Vectrosity is on the GUI layer.. and now that I realize it, we're setting it way below the GUI layer.
Take a look at the demos that come with.