// Update is called once per frame void Update() { if (spawnerScript.end) { float score = spawnerScript.GetScore(); StaticChildren.currentStudent.joy -= Mathf.RoundToInt((20 * (score / 100))); GameManager.minigamesComplete++; Destroy(transform.gameObject); } }