Hi,
I have a series of distancejoint2d’s forming a chain and at the starting link, a linerender is attached which draws a repeated material over all of the chains points:
[SerializeField]
LineRenderer lineRenderer;
[SerializeField]
Transform[] links;
[SerializeField]
float lineWidth = 0.1f;
void Awake()
{
lineRenderer.SetVertexCount(links.Length);
lineRenderer.SetWidth(lineWidth, lineWidth);
lineRenderer.material.SetTextureScale("_MainTex", new Vector2(links.Length, 1f));
}
void Update()
{
for(int i = 0; i < links.Length; i++)
{
lineRenderer.SetPosition(i, links[i].position);
}
}
The attached material is using the standard shader with an albedo, normal and emissive texture.
The problem I am having is the line is always solid black.
This material is crucial to fitting in the the rest of the scene.
Any help as to why this is happening or how to work around it?