Ok so I have the following update function:
function Update () {
for (i=0; i <= Enemies.length-1; i++)
{
if(Enemies[i] != null){
var bounceController = Enemies[i].GetComponent(inGame_BounceStarter);
Enemies[i].transform.position.z = 0;
Enemies[i].rigidbody.velocity = bounceController.vel;
}
}
}
Now in the editor this works as expected and causes the enemies to bounce around at the velocity “bounceController.vel”. However when I try and compile for iPhone it comes up with the following error (but it dosent when I just hit play in the editor):
Assets/Scripts/EnmyBounceController.js(14,74): BCE0019: 'vel' is not a member of 'UnityEngine.Component'.
Now am I just accessing the variable of the component incorrectally (in which case what is the best way to do it?)
Or is this a bug with Unity Android due to the fact it’s still in “beta”?