void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Person")) { am.Play("Collect"); increaseRescued.IncreaseRescued(); DisplayRescueMsg(other.gameObject.transform.position); } else if (other.CompareTag("Chip")) { am.Play("Collect"); GameData gameData = GameObject.FindWithTag("GameData").GetComponent <GameData>(); gameData.AddFoundEntry(other.gameObject.GetComponent <JournalChip>().ID); } else if (other.CompareTag("Slow")) { am.Play("Slow"); sm.SpeedDebuff(); } else if (other.CompareTag("Asteroid")) { deathPS.transform.position = this.gameObject.transform.position; deathPS.SetActive(true); am.Play("Explosion"); resultTitle.GetComponent <Text>().text = "Hit by an Asteroid..."; GameObject.FindWithTag("Endgame").GetComponent <EndGame>().ShowResults(); } Destroy(other.gameObject); }