Materials Compatible with LineRenderer

I don’t want to use the "Additive Particle" shader with my line. I want a solid color instead of the transparency.

The problem is that whenever I use diffuse and try to set the color through LineRenderer.SetColor() or “myLine.renderer.material.color” it doesn’t work. It always comes up black.

How can I set a solid color to a line created with the LineRenderer class?

Try Particles/Alpha Blended shader, it works for me!

Answer to this in 2022 using version 2021.3.6f1 (Unity-2021-3-LTS):

The simplest solution for me to change the color of the Line Renderer is to create a new material of shader type Sprites/Default and drag the new material into the material slot of the Line Renderer component on the Inspector. You can then edit the material by changing the color and transparency level to what you want.

For Unity 2022.3.18f and similar

Mobile/Particles/Alpha Blended

Now you can ajust the color of the trail via the Particle System. With the Sprites/Default you can’t control the color via the Particle System.