Reputation: 47
trying to update this script and I can't figure this one out
This is the code:
Vector3[] linePoints = new Vector3[] { blinkParticleInstance.transform.position, blinkParticleFloorInstance.transform.position };
VectorLine line = new VectorLine("MyLine", linePoints, blinkLineMat, blinkLineWidth);
This is the error:
cannot convert from 'UnityEngine.Vector3[]' to 'System.Collections.Generic.List<UnityEngine.Vector3>'
Upvotes: 0
Views: 73
Reputation: 90862
well sounds like VectorLine
is expecting a List<Vector3>
but you are passing in a Vector3[]
.
Just do
using System.Linq;
...
Vector3[] linePoints = new Vector3[] { blinkParticleInstance.transform.position, blinkParticleFloorInstance.transform.position };
VectorLine line = new VectorLine("MyLine", linePoints.ToList(), blinkLineMat, blinkLineWidth);
or use a list in the first place
List<Vector3> linePoints = new List<Vector3> { blinkParticleInstance.transform.position, blinkParticleFloorInstance.transform.position };
VectorLine line = new VectorLine("MyLine", linePoints, blinkLineMat, blinkLineWidth);
Upvotes: 1