- Home /
No appropriate version of 'UnityEngine.Object.Destroy' for the argument list '(Object)' was found.
I am programming an iPhone game, and when I use #pragma strict I get the following error:
No appropriate version of 'UnityEngine.Object.Destroy' for the argument list '(Object)' was found.
This is the line of code triggering the error:
Destroy( coinsArrayList[ i ] );
the coinsArrayList is populated with Coin GameObjects.
I'm new to Unity so I apologize if this is a stupid question :P
Answer by Eric5h5 · Jan 11, 2011 at 03:47 AM
I guess you're using Array...the best thing is to not use Array, but List.<GameObject>
instead.
Lists look useful, I had no idea they existing. Unfortunately, as far as I know you can't declare lists in Unity's Javascript (which is what I'm using).
Is there an alternative way to deal with this problem?
You can; I wouldn't have suggested it otherwise: var foo = new List.<GameObject>();