Forum rules - please read before posting.

Container - drawer/chest

I am trying to make a wall full of drawers, with several items inside it, like a inventory ( don't need to be a real item). The player have to click on the drawer and choose a password. I don't know how to do it. Ive searched in all videos, but only found something like that in the manual, but It didn't work or I didn't understood. My main issue now is that, I cant simple make the drawer with the items inside and make the player take from it.
Can anyone explain step by step?
Also, I am not worrying with animations or any of that right now, just want to make the container work with the inventory.
My game is a 2.5d, with 2d assets.
Unity 2021.2.0a5.926
Interaction method : choose hotspot then interaction
*English is not my language, so if you can, use simple words.


  • Welcome to the community, @Naver78.

    You'll first need to add a Container to your scene, to store the list of items in the drawer. This can added from the "Logic" panel in the Scene Manager.

    In its Inspector, you can then choose what items it holds.

    A Container doesn't get used directly by the Player (like a Hotspot). Instead, you open it using the Container: Open Action in your Drawer Hotspot's Interaction.

    You'll need to make sure that you have a Container menu in your Menu Manager to display these items when it is opened.

    The "Container" menu, which is part of AC's default interface, is set up to handle this. If you don't have it listed in your Menu Manager, you can copy it from the Demo_MenuManager asset. To do this, switch your Menu Manager asset file to Demo_MenuManager (at the top of the AC Game Editor window), copy the Container menu, then paste it into your own Menu Manager.

    With this menu, the Player can then select items to take from it. You can configure the menu's appearance and settings to suit your style.

    That should be about it. If you have trouble, best to share some screenshots that show what you have, so that we can see where things are going wrong.

  • Thank you, It worked, but now, if I select hotspot detection method 'player vicinity', it wont detect the hotspot. 'Mouser over' work just fine. I have the hotspot detector and I put it in the ignore raycast layer.
    Is there something else I am forgetting?

  • also, could you give me a hint of how to put passwords in the drawers? It must be simple, but I am new at this.

  • nevermind, I found on this fórum some hints.

  • For which, the password or the Hotspot Detector?

    For the Hotspot Detector, make sure you've assigned it in the Player's Inspector - having it be present in the Player's hierarchy isn't enough by itself.

  • all right, I will check that.
    I found some discussions about passwords. In my case, would be better to use a variable component attached to the drawer and then make a prefab to make more of it?

  • If you wish to have the same puzzle repeated, yes - making a prefab for it would be best.

    I'd first recommend getting the password logic working with just one object first - while using a Variables component. Prefabbing puzzles can be a tricky topic, so it's important to have things working with just one before making prefabs. A tutorial on this topic can be found here.

  • I saw that, I'm going to work on that after I test my puzzle. I'm having some problems tho. Its very simple, a enemy will tell the password, I will put the password in the drawer and get it open. I did as the tutorial ''Letting the player enter their name'' told, and then, as you told in this discussion, I called the variable check action.
    Its not working because the container is not locked, or the menu don't show up. I'm not sure where to put the action list, I tried to put in the hotspot interaction, in the container actionlist when turn on...but it doesn't seem to work, and after a while, errors start to appear.
    where should I put the action list? Its everything right?,,

  • So you mean for the password menu to first show, and then - if the Player enters the correct password - the Container then opens?

    At the moment, you're checking the variable at the moment the password menu turns on - before the Player has a chance to enter in a password.

    At the time the Player clicks the OK button, the logic should be:

    1. Update the Variable with the contents of the Input box
    2. Check this Variable's value
    3. If the value is correct, open the Container

    Move your Variable: Check Action instead to your Senha Gaveta ActionList - in between the Variable: Set Action and Container: Open Action. Remove the Container: Open Action from your hotspot senha ActionList.

    after a while, errors start to appear.

    If you still get these after the above changes, share them in full so that we can see what's going on.

  • I did, it worked, I am so glad, Ive been trying for days, but it didn't occur to me, that I had to put the actionlist in the OK button, and only call the menu from the hotspot. I will make discussion with this info to help other people. Now I will make a prefab with the youtube tutorial and start to work in my enemy path problem, but then I will open another discussion if I don't find a answer. Thank you.

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.