// Collision logic between the pig and other units. protected override void OnCollisionEnter(Collision collision) { if (collision.collider.CompareTag("Wolf") || collision.collider.CompareTag("Chicken")) { Fighter fighter = collision.gameObject.GetComponent <Fighter>(); if (fighter != null) { UnitPush(fighter, fighter.PushForce); m_Pig.Captured(fighter); } } }