IEnumerator OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Spotlight")) { userControl.ChangeCaughtState(true); yield return(new WaitForSeconds(DelayTime)); Time.timeScale = 0; GOCanvas.GetComponent <Canvas>().enabled = true; GOCanvas.GetComponent <AudioSource>().enabled = true; spottedCamera.GetComponent <AudioSource>().enabled = false; Cursor.visible = true; } }