This may already be effectively solved. But since it’s open I wanted to throw in my 2 cents. I would handle this by setting a global variable that stores the current state when the key in pressed to view the character sheet before changing myState.
If (Input.GetKeyDown(KeyCode.C) {
//"C" key opens character sheet
CurrentState = myState;
myState = CharacterSheet;
}
Then use that variable to return to the previous state when exiting the character sheet from the character sheet state.
If (Input.GetKeyDown(KeyCode.E) {
//"E" key exits character sheet
myState = CurrentState;
}
This doesn’t require reaching very far outside what’s in the course up to this point. It would only be creating a global variable to use for tracking what the state is when the player enters the character sheet.