- Home /
Referencing a script works... but not on iOS
Within my player script, I am referencing an array of objects from a different script so that I can destroy each object and wipe the array.
This is how I reference the other script in the player script:
public var scriptTarget : GameObject;
var waveScript : WaveGenerator = scriptTarget.GetComponent("WaveGenerator");
And this is how I destroy each object and wipe the array:
for(var i : int =0; i < waveScript.currentWaveArray.length; i++)
{
Destroy(waveScript.currentWaveArray[i]);
}
waveScript.currentWaveArray.Clear();
This works perfectly fine when I play in-editor. However, this seems to not function when deployed on iOS.
Any ideas what I need to do to get this working on iOS?
Thanks!
Comment
Your answer
