Hello,
I try to make a puzzle where a specific order of use-interactions triggers a cutscene: for example piano keys have to be pressed in a perfect sequence to play the "right" melody; in a way identical to Zelda: Ocarina of Time's playing mechanic.
First I tried to solve it with variables, setting a new score for the right use-interaction each time they get used. A "wrong" interaction would set the score back to zero. Using the interactions in the right sequence therefore results in the correct score which then triggers the cutscene.
This seems to be a pretty complicated way of doing this and it has problems: when, for example, the first correct interaction gets used two times in a row, it messes up the score completely.
I hope somebody here is familiar with Ocarina of Time and can point me in the right direction.
Thanks in advance!
EDIT:
I'm on Unity 2022.2.14 and AC 1.78.3
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I expect there's a few ways to tackle this kind of logic, but the way I've found is to use a PopUp or Integer variable that keeps track of the player's score.
If you know the current score, you can check if the chosen interaction is correct - repeated notes can be accounted for.
An example of this technique can be found in the "Combination lock" scene in the "Puzzle template: Simple examples" package over on the Downloads page.
Thanks for your quick response! I actually tried to use Integer variables, thanks for confirming that this might be a way to do it.
Also thanks for the pointer to the lock-example, sounds like similar processes are needed for both puzzles.