Hi Jon,
Ah I see. That was a very brief snippet above to convey the concept rather than a piece of working code, sorry for any confusion.
So, my understanding of the Text101 game is that AdventureGame.cs manages the game and you have unique scriptable objects which derive from a class called State.cs.
So,if I wanted to model moving around my home I would create a State for “Living Room”, “Kitchen”, “Hallway” etc.
I believe at the moment that when you create a state you can add other states to it via the Inspector which become the options for moving to other states based on player choice.
My suggestion was that you could use the existing model but always have one additional state which would be the one to take you back. So, if the array size for the options in one state is 3, set it to 4 and add the state which is the previous place they have come from.
I think the player options are numbered aren’t they? So, you might want to make sure that the “Back” option was always the first one in the list, if you did this you could then add some code to display “Back” as the option for the first item in the array.
The other way I was describing would require a member variable in your AdventureGame.cs script for the previous state as mentioned. The current state you probably already have access to though, whilst it may have a different variable name, it’s effectively the one that is currently loaded in.
If you would like to share your project files with me I can take a quick look and give you some more specific pointers, I’m talking at the moment from only glancing at the updated course content briefly and obviously am not fully aware of your project.
If you zip up your project files and share them I will happily take a look in about an hour.
The forum will allow uploads of up to 10MB, if your project files (zipped) are larger than that you would need to use a service such as Google Drive or Dropbox, and then share the URL.