//Called when the Sythe overlaps the Enemy void OnCollisionEnter(Collision collision) { iDestructable other = collision.gameObject.GetComponent <iDestructable>(); if (other != null) { other.iDie(); Destroy(gameObject); } }
void OnCollisionEnter(Collision collision) { print("Colliding!!"); iDestructable other = collision.gameObject.GetComponent <iDestructable>(); if (other != null) { print("Pow!"); other.iDie(); } else { Debug.Log("Wimpy..."); } }