I am trying to initiate a health drop when a particle collision takes place. I am trying to use a for/in loop to reference each possible collider and I am obviously doing something wrong. My code is:
function OnParticleCollision (other : GameObject)
{
for (var zombie : GameObject in GameObject.Find("MainCamera").GetComponent("zombieArray"))
{
if (other == zombie)
{
...other code...
}
When run and a particle is shot I get this error on the line starting the for/in : ApplicationException: Argument is not enumerable (does not implement System.Collections.IEnumerable). Boo.Lang.Runtime.RuntimeServices.Error (System.String name) Boo.Lang.Runtime.RuntimeServices.GetEnumerable (System.Object enumerable) UnityScript.Lang.UnityRuntimeServices.GetEnumerator (System.Object obj) vomitHit.OnParticleCollision (UnityEngine.GameObject other) (at Assets/Scripts/vomitHit.js:29)
Any help is very much appreciated!