Forum rules - please read before posting.

I need help with my lock puzzle

Hey Chris,
I created a simple lock puzzle mechanic that lets the player press "Turn Left" or "Turn Right" to enter the correct combination and solve it. The puzzle is complete and functioning well; however, the only missing piece is how to change the puzzle background whenever the player presses left or right.
https://prnt.sc/v3X60fMNct20

I have 4 backgrounds in total, each representing a different lock state.

https://prnt.sc/xSuofryYluLj
https://prnt.sc/nLVMFF16irsV

Comments

  • Switch to Unity UI for your Menu's rendering, so that you can use an Animator component to control which background is displayed.

    Make use of an Integer Animator parameter to control the transitions, using the same values as your puzzle's Global Variable. You can then attach the Link Variable To Animator component to sync the variable and parameter's values.

  • Hi Chris,
    This is becoming way too complicated for me to handle. I’m not sure if I can ask for help here, but are you open to assisting me with implementing this puzzle in my game? I will, of course, compensate you for your work.

  • How far did you get with the above? Share screenshots of your progress, and where the issues lie, and I'll try to point you in the right direction.

  • I didn't get very far, to be honest. Variables in general confuse me, and I was barely able to implement them without the "changing image" function.My current setup look like this:

    Currently, the puzzle can be turned left and right and solved; however, it’s supposed to change the lock image with every turn. You can watch the puzzle here: https://drive.proton.me/urls/PKB7H6SRY4#zwjCKAk42OrW

    And these are the lock images to represent each turn pressed: https://drive.proton.me/urls/C0B2PXN5Y4#QQrhM2GKmcx4

  • You need to start by converting the Menu to a Unity UI one, so that you can use an Animator to control the background sprite.

  • Can you elaborate on how to update my current action lists to incorporate the animation?

  • I've converted the Menu to Unity UI. https://prnt.sc/z3ROzv-TXyxG

    Default Image is the image that will appear first.

  • Can you elaborate on how to update my current action lists to incorporate the animation?

    If your ActionLists reference a Global Variable, you don't need to make any changes.

    What you'll need to do now is attach an Animator to your Images object, and add 5 animations to it - that each show a different image chid object, while hiding the others.

    You can then use an Integer parameter to control the transitions to them. Have these use the same values as the Global Variable. You can then attach the Link Variable To Animator component to sync the two together.

  • Hey Chris,
    I could use your opinion on my puzzle.
    Right now, the puzzle is solved by pressing the following sequence: Turn Left, Turn Right, Turn Right, Turn Left. The issue is that if the player just keeps pressing randomly, they could eventually get it right without understanding the clue.

    I’d like to add a move counter that tracks the number of inputs, and after 4 incorrect moves, it plays a "wrong" SFX and resets the puzzle.

    Is something like this possible to implement in AC?

    Turn Right Actionlist: https://prnt.sc/Ut7mrgOoXrdk
    Turn Left Actionlist: https://prnt.sc/vkVOd7shTnHw
    AC Menu: https://prnt.sc/n1K3bqmNx4XR
    https://prnt.sc/83Py73vLLzxy

    Thanks!

  • You can use an Integer variable to keep track of the number of moves the Player has made, which increases each time.

    There's a "Combination lock" example scene that uses this approach in the "Puzzle template: Simple examples" package over on the Downloads page.

  • Thank you, Chris. I will download the example puzzle and learn from it.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.