- Home /
The question is answered, right answer was accepted
Linerenderer pink and not working after build .exe
Hello, I have a yellow linerenderer that jumps from the last waypoint to a new waypoint when the last one is reached. So from 1 - 2 to 2 - 3. However, after I built my game it only jumps to the first waypoint, doesn't go further and is pink again. I am completely clueless how to fix it.
Here is the code of the linerenderer.
lineRenderer.SetPosition(0, startPosition);
lineRenderer.SetPosition(1, endPosition);
lineRenderer.SetColors(Color.gray, Color.green);
lineRenderer.material = new Material(Shader.Find("Particles/Additive"));
Answer by tanoshimi · Jan 23, 2015 at 11:42 AM
Did you include the Particles/Additive shader in your build? (via Project Settings -> Graphics -> Always Included Shaders)?
A trick to not have to manually include things in the build is to place the $$anonymous$$aterial, shader ... in an Inspector variable, ins$$anonymous$$d of using Find. Unity will then "know" you are using it.