- Home /
Please Help!!! my LineRenderer Script is not show when bulid on android device
Script
public var radius : float = 1.0;
private var theta_scale : float = 0.1; //Set lower to add more points private var size : float = (3.0 * Mathf.PI) / theta_scale; //Total number of points in circle. var c1 : Color = Color.white; var c2 : Color = Color.white; function Start() { var lineRenderer : LineRenderer = gameObject.AddComponent("LineRenderer");
lineRenderer.material = new Material(Shader.Find("Particles/Additive")); lineRenderer.SetColors(c1, c2); lineRenderer.SetWidth(0.1, 0.1); lineRenderer.SetVertexCount(size);
var i : int = 0;
for(var theta : float = 0; theta < (2.0 Mathf.PI); theta += 0.1) { var x : float = radius Mathf.Cos(theta); var z : float = radius * Mathf.Sin(theta); var pos : Vector3 = new Vector3(x, 0, z);
lineRenderer.SetPosition(i, pos); i += 1; }
}
Answer by tanoshimi · Feb 27, 2015 at 11:43 AM
My guess would be that you're not including the Particles/Additive shader in your build.
Go to Edit -> Project Settings -> Graphics and make sure it's listed under "Always Included Shaders".
Your answer
Follow this Question
Related Questions
Transparency artifacts android 0 Answers
texture/mesh/shader problem on Android 3 Answers
how to change the maintexture from another scene? 1 Answer
Change GUITexture Using UnityScript 1 Answer
Wand Magic Tool 0 Answers