Why do i get this error for this javascript?
ApplicationException:Argument is not enemerable(does not implement System.Collections.IEnumerable).
function OnTriggerEnter(other : Collider){ //this function checks for the collision of the local Collider which is Trigger (i.e. field-like, and not rigid, objects can pass through the field, but will trigger the function)
if(other.gameObject.name == "Player"){ //the function took an argument "other", it refers to a collider that is passing through the trigger field
GameObject.Destory(other.gameObject); //using our keyword that refers to that external collider, it picks the whole gameObject that somehow relates to that collider, that is, holds it. We than destroy that gameObject
for(var child : Transform in transform.gameObject){ //
5. GameObject.Destroy(child.gameObject); //those three lines are only needed if you have children of the player objet that have to be removed
} //otherwise, you can remove those 3 lines
Debug.Log("Player was brutalized"); //write a message in a console that the player has r.i.p'ed
}
}