- Home /
Android: Material not getting added when "Build and Run"
Hello,
I have a line a code that adds a material to a LineRenderer
void Start () {
_targetLine.material = new Material (Shader.Find("Particles/Additive"));
_targetLine.enabled = false;
}
This works when I test it using a play button, but when I build and run on my device, the material isn't added. The strangest thing of all is that a simple game I made when I first started learning Unity doesn't have this problem with the same lines of code.
Is this a known issue with a solution?
Thanks!
EDIT:
http://answers.unity3d.com/questions/533973/where-do-input-files-go-so-built-games-can-find-th.html
this seems related, but I have no idea what they are saying...
Answer by ina · Feb 06, 2014 at 06:35 PM
It might be that the device does not support that particular particle shader. What OpenGL ES does your test device use and what version of Unity?
Also, try dragging a regular Particles/Additive material in on assignment.
As stated earlier, it works with other projects, not just this particular one.
With that said, how do I add Particles/Additive material to my assets folder so that I can drag it in?
Okay, so I downloaded the shaders from http://unity3d.com/unity/download/archive, then added the shader to a new material to be dragged to the LineRenderer.
Thanks for the help
Your answer
Follow this Question
Related Questions
Build & Run Problems it Only loads my splashscreen 2 Answers
Build and Run doesn't install directly to Device. 2 Answers
Build and run for android doesn't work 2 Answers
Re-posting Build and run problem 0 Answers
Suddenly I can't build my game on Android Anymore :"Unable to sign the application.. 2 Answers