Forum rules - please read before posting.

SUPER Newb needs help creating an option for players to enter a password

Hi any patient person-

I am just a middle-aged mom and former elementary school teacher who has found herself designing a point-and-click adventure game for her newish job designing escape-room games for elementary kids... long story. Brass tacks: I need the kind of help you would give a 2nd grader.

I have [somehow] successfully started an AC game in which a person (NOT a player) is navigating though a lab (aka "escape the room" scenario) in the pursuit to foil the nefarious plan of a mad scientist who aims to put soap in the water. I want to include an element in which a player has to enter a password (into a Menu input field) to bypass a "locked" gate. Thus far I have SOMEHOW succeeded.

Here is where my serious lack of coding or scripting abilities comes into play. I need to understand (at the 2nd grade level) how to:

  1. create a set of variables that will
  2. link to a button that will
  3. open access to a locked area (scene) via password

Me no talky C# (nor script nor variable nor code nor beep-boop-beep) at all, so the manual is not helpful. I have watched the 2D and 3D tutorials - super helpful! The forums are sort of helpful, but I get lost when I see a phrase like "this can be done with a simple script where beep-bloop-schmee..." I have even resorted to ChatGTP (which has been completely wrong in some instances) to help me unpack the steps. I understand that I need to create a Menu and that I need to call upon that menu in order to have players [unknowingly] activate a hotspot that activates the menu that triggers a check that verifies against a variable that runs a script... etc. I just cannot understand HOW to do that. I have read and implemented the element to have players enter their names - all of that is set up; I just need help in VERY BASIC WORDS on how to tie the Menu's button to the script that checks the password and allows players to proceed.

PLEASE? Not stupid... just learning!

AC v1.77.1
Unity 2021.3.23f1 Personal (just learning for now)

"Stairs" scene with hotspot and collider
Inspector for "Stairs" scene
Gate Lock Menu 1
Gate Lock Menu 2


  • Welcome to the community, @takealltheadventures.

    A password puzzle in your game can be done with the Input menu element - a tutorial on its usage can be found here.

    Essentially, the steps involved would be to have the text entered here be send to a String variable, that can then be compared with the correct answer.

    1. Create a Global String Variable named e.g. "InputPassword". Don't worry about its default value - this will be set at runtime.
    2. Create a Menu with an Input element - it looks like you've done this
    3. In your "Verify" button's properties, set the Click type to Run Action List, and assign an ActionList asset to run.
    4. Begin this list with a Variable: Set Action, set to affect "InputPassword", and with the Source set to Set As Menu Element Text. Enter in the name of the Menu and the Input element underneath - this is the same idea as that covered by the tutorial above.
    5. That Action will set the "InputPassword" String variable to match whatever was entered into the Input box - so you can now follow this up with a Variable: Check Action to compare this variable with the answer.
    6. It might be easier to continue here in a separate Cutscene in the scene. To do this, create a new Cutscene and have the "If condition is met" branch run an ActionList: Run Action to run this new Cutscene.
    7. This Cutscene can then house the Actions you want to run when the puzzle is solved. If you've got a Bool Variable to represent the "locked" state of the gate, for example, you can have this Cutscene run a Variable: Set Action to set this value to False. To create a Bool variable for the gate, you don't need to make it global - since it's only used in this scene. Instead, you can attach a Variables component to the gate GameObject in the scene, and define your variable there.
    8. As part of your Hotspot's "Use" interaction, you can now run the Menu: Change state Action to bring up the "Gate Lock" menu. If you want this to only show if the "locked" variable is True, you can precede this Action with a Variable: Check.
  • Thank you very much for this. :) Indeed, I already had most of this built, so that's very reassuring! The piece I seem to be missing is how to tell a game thing (hotspot? object?) what the correct password is supposed to be. Once the player types the password (PLEASE, for example) into the input box, that should trigger the next action (open the gate). Where do I indicate what that password is?

  • edited April 2023

    I am by no means an expert at this, but this worked for me.
    I did a Variable:Check and then added the Object:Animate

    I posted an image to help clarify. Hope this helps and I'm not too far off.


  • Oooh - I poked around a little bit and I figured it out! 😃 I had to put the desired password into the String box of the Variable: Check action!

    Where to put the correct password

    Thanks so much for all the help! Now I'm off to figure out how to word my next question...

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.