Specifying Next State Input (Development Suggestion)

While thinking up a story for my game I thought of something, “What if I want change the story input and not limit it to just the Alpha keys” and so I played around and this was my solution.


Add a serialized variable for KeyCode and make it an array. Then add a public method to get the KeyCodes.


In the ManageState method make for loop that goes through each KeyCode and checks if it has been pressed and if it has in goes to the state of the same position.

On Unity:

As seen above “Alpha 3” will go to “Room_1” and “Alpha 0” will go to “Room_2”.

And like that you can customize which key goes to which state. So let me know what you think and if you have any suggestions.

Privacy & Terms