// Update is called once per frame void Update() { // check if any key was pressed if (Input.anyKeyDown) { // if the key pressed is the correct key, increment the if (Input.GetKey(code [numCorrectLetters])) { numCorrectLetters++; } else { numCorrectLetters = 0; } } if (numCorrectLetters == codeLength) { manager.loadAnimation(); } }