I want to creat a puzzle where the player has to press buttons in the correct order. So far I have managed to write a function that generates an array of ints. Those ints correspond to the buttons that need to be pressed. But how do I now check if those buttons are actually pressed and in the correct order?
I’m new to programing with nodes and I don’t realy understand yet when which node gets executed. If I write a function that just checks for what buttons are pressed and I call it every tick, then it won’t remember the last buttons (aka I don’t understand how “global” variables work in Blueprints). Also if I constantly loop throug this function wouldn’t I freeze my game?
I would aprecheate any help and would like to ask to include pictures of your solution since I still struggle with understanding the structure of nodes.
You can assign a unique ID to every button and add them in an array.
Then randomize that array, that will be your unique sequence.
Now store that randomized array in other variable which you can use to compare and verify when the player is pressing buttons.
So when player is pressing the button add the assigned id of that button in a separate array
You can either compare it with the randomized array every time player clicks any button or compare it altogether when player clicks the last button