void OnCollisionEnter2D(Collision2D other) { if (debug) { Debug.Log("Collision With Player Detected" + "\n" + "Other Object:" + "\n" + other.gameObject + "\n" + "Other Tag: " + other.gameObject.tag + "\n" + "Other Mass: " + other.gameObject.GetComponent <Rigidbody2D> ().mass + "\n" + "Player Mass: " + rbody.mass); } // If an enemy is touched, see who is bigger if (other.gameObject.tag == "Enemy") { // If player has higher mass (and thus size), grow player and destroy enemy if (rbody.mass > other.gameObject.GetComponent <Rigidbody2D> ().mass) { gameController.AbsorbGrowth(gameObject, other.gameObject); gameController.EnemyDestroyed(); gameController.ScoreIncrease(other.gameObject.GetComponent <Rigidbody2D> ().mass * 100.0f); eat.Play(); Destroy(other.gameObject); // If enemy has higher mass or equal mass (and thus size), grow enemy and destroy player } else { gameController.AbsorbGrowth(other.gameObject, gameObject); gameController.GameOver(); other.gameObject.GetComponent <AudioSource> ().Play(); gameObject.SetActive(false); //Destroy (gameObject); -- Removed because it threw an error upon destroying the primary player } } }