To keep it simple, I am trying to make a puzzle in my game where you activate different coloured switches in one specific order to progress. Parts of the answer is scattered around the area and if you answer incorrectly, the player gets shocked and loses 20% of their hp as to not brute force their way through.
I have looked up stuff online and couldn't find any thing specifically about a button combination, but rather only a certain amount of buttons or a number-input combination lock. I want the player to push the buttons Blue -> Green -> Yellow -> Red in that order and after they've pushed every button in the wrong order, they get punished. My current system is to have a variable increase by one after every right button press and when it's equal to 4, the door opens. I however can't come up with a way to make the incorrect way work, which I tried to have a seperate line of control-switches activate and the variable being set to 0.
Are there any tutorials out there I may have missed in my search or is there a simple solution to this problem I've been having?
I have looked up stuff online and couldn't find any thing specifically about a button combination, but rather only a certain amount of buttons or a number-input combination lock. I want the player to push the buttons Blue -> Green -> Yellow -> Red in that order and after they've pushed every button in the wrong order, they get punished. My current system is to have a variable increase by one after every right button press and when it's equal to 4, the door opens. I however can't come up with a way to make the incorrect way work, which I tried to have a seperate line of control-switches activate and the variable being set to 0.
Are there any tutorials out there I may have missed in my search or is there a simple solution to this problem I've been having?