void OnTriggerEnter2D(Collider2D coll) { if (WorldTracker.worldNumber == "1-4") { if (canPlay) { sfx.PlayWorldDoneMusic(); canPlay = false; } } // This function calls the "FinalScore function every 0.1 seconds InvokeRepeating("FinalScore", 0.01f, 0.1f); }