hello and hi, i have made a simple shooter game in unity its running well in unity player also i can make a built for desktop version without error but while building for android i am getting following error and such 20 errors...... Assets/Cartoon Soldier/Scripts/guns/dustCloudGenerator.js(24,56): BCE0019: 'velocity' is not a member of 'UnityEngine.Component'. Assets/Cartoon Soldier/Scripts/guns/bulletTrace.js(65,89): BCE0019: 'Length' is not a member of 'Object'. Assets/Cartoon Soldier/Scripts/guns/bulletTraceGenerator.js(17,99): BCE0019: 'velocity' is not a member of 'UnityEngine.Component'. . . Assets/Cartoon Soldier/Scripts/guns/bulletTraceGenerator.js(20,78): BCE0019: 'bulletSpeed' is not a member of 'UnityEngine.Component'. . like
You’re using lazytyping, which is not supported on mobile devices. You have to be sure that your variables are the right type before you use them on mobile.
For instance:
var myClass : MyClassName = go.GetComponent.<MyClassName>();
myClass.myVariable = value;
But not:
var myVar = go.GetComponent(MyClassName);
myVar.anything // this will throw an error on mobile devices
If you add “#pragma strict” on its own line at the top of each script, you’ll get compiler errors for most things that won’t run on a mobile device.