void OnCollisionEnter(Collision coll) { if (coll.transform.tag == "Zombie") { DestroyableObject ZAI = coll.gameObject.GetComponent <DestroyableObject>(); if (ZAI.check(_word)) //if the words match up then we have hit our target //Do damage to this enemy { ZAI.hit(_weapon.getHitPower(), _weapon.getStunChance()); //Debug.Log ("Checking for splash damage position.x:" + transform.position.x + " position.y:" + transform.position.y); //Do splash damage GameObject [] allZombies = GameObject.FindGameObjectsWithTag("Zombie"); foreach (GameObject go in allZombies) { if (Vector2.Distance(go.transform.position, transform.position) < _range) { //Debug.Log ("Splashing Object:" + go.name); go.GetComponent <DestroyableObject>().splash(_splashDamage, _speedModifier, _knockback); } } } else if (_weapon.Penetrating) { ZAI.hit(_weapon.getHitPower(), _weapon.getStunChance()); } } if (!_weapon.Penetrating) { Destroy(gameObject); } }