private void OnTriggerEnter2D(Collider2D collision) { FlockAgent collider = collision.gameObject.GetComponent <FlockAgent>(); if (collider != null) { collider.KillSelf(); } }