private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "GoalSphere") { tmp.text = "Good job! Escape the labyrinth by finding your way back to the entrance."; cm.RestoreMaterial(); reachedEnd = true; if (firstTimeLogged) { Destroy(guld); mt.firstTripTime = Time.time - mt.startTime; mt.firstSummedLength = mt.SummedLength; } } if (other.gameObject.tag == "StartSphere") { tmp.text = "Follow the red path to the treasure. Remember you need to find your way back."; } if (other.gameObject.tag == "StartSphere" && reachedEnd) { tmp.text = "Well done. Loading next labyrinth"; mt.secondTripTime = Time.time - mt.startTime; mt.secondSummedLength = mt.SummedLength; mt.Finished(); } }