Materials Compatible with LineRenderer
Asked Answered
M

3

0

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?

Manifestation answered 15/4, 2024 at 12:25 Comment(0)
G
0

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

Gesualdo answered 15/4, 2024 at 12:26 Comment(1)

it works for me too!

Tarrant
M
0

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.

Multifoliate answered 15/4, 2024 at 12:26 Comment(0)
I
0

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.

Inconsistent answered 15/4, 2024 at 9:28 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.