void OnTriggerEnter2D(Collider2D other) { if (other.tag == "FallDetector") { //when player goes to FallDetector zone //transform.position = respawnPoint; levelscript.Respawn(); } if (other.tag == "CheckPoint") { respawnPoint = other.transform.position; } if (other.tag == "FinishFlag") { levelscript.GameCompleted(); //Destroy(other.gameObject); } }