- Home /
Linerenderer with shader not working Android
I tried the following Shader on Unity 4.1.3, it works perfectly well on my Desktop but on Android(Samsung Galaxy Note 2) it does not render properly, it renders as pink without any white color and the overlay is not at all happening.
Shader "Shader222" {
Properties {
// Adds Color field we can modify
_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader {
Tags {"Queue"="Overlay" }
Pass{
Color [_Color]
ZTest Always
}
}
}
lRend.material.shader = Shader.Find("Shader222");
Answer by JackA · Oct 13, 2013 at 12:20 PM
Ok I fixed this, (first I debugged and found through adb logcat that the returned Shader through Shader.Find was null) after that I copied the Shader to the resources folder and it worked fine.
I guess because it was in the Assets folder and not the resources folder and Shader.Find finds only from Resource folder as pointed by http://docs.unity3d.com/Documentation/ScriptReference/Shader.Find.html
Thank you Soooo much for posting this, I would never have thought my linerenderer couldn't find one of the builtin shaders... hours of fruitless bug hunting avoided
Your answer
![](https://koobas.hobune.stream/wayback/20220613115839im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is it possible to use DrawMesh or DrawMeshNow in an editor window? 1 Answer
Can't see objects properly and can't enlarge it 0 Answers
Drawing area of effect procedurally 0 Answers
EU 4 Map Shader 2 Answers
How to bump the graphics down? 0 Answers