Forum rules - please read before posting.

Toggling a Menu

Another generic title for my subject! Essentially I have a map that the player can access however I'm struggling how to allow the player to access the map because the map is different depending on what scene the player is in and there are only certain situations where I want the map to be accessible.

Ideally I want when the player presses 'M' on the keyboard for the map for that particular scene to pop up (so I'm guessing that the map will essentially be a menu that can be turned on/off via the input key). However this means that I'm struggling to open different Map menus depending on which scene the player is in, also the player would be able to open the map menu using the 'M' keyboard at any time during gameplay (which I don't want).

I can easily setup an action list to behave in the exact way that I want however I can't seem to be able to open the action list based on pressing a certain key - so the easiest solution for me is to call the action list each time the 'M' key is pressed (and then I can make sure that this does nothing when I don't want the map to be opened and then ensure that the correct map opens in the correct scenes when I do want the map to open). I have searched all day but to no avail (apologies if this has already been answered and I've missed it though)!

Comments

  • Seems to me you just answered your own question or did I miss something?

    The logic when the map key is pressed would be to check if there's a map to show in the current situation, then switch on the correct map according to what scene the player is in - which is basically what you're saying anyway, isn't it?
  • You can use Active Inputs for this - see Section 2.14 of the Manual.

    Active Inputs allow you full control over what happens when a given input is pressed, so you can run an ActionList that first checks the current scene, and affects the Menu accordingly.  Set the Menu's Appear type to Manual, and you'll be able to open and close it with the Menu: Change state Action.
  • @Snebjorn - In a way I did however I was struggling with exactly how to carry out the check on whether the map key is pressed or not without any scripting (as you have likely already figured out I'm not too experienced so avoid scripting at all costs). Thankfully though Chris' advice for Active Inputs is exactly what I'm looking for (and believe this is what you were advising too however when I previously referred to 'Inputs' in my post I had only delved into the Unity Input axes and never seen the AC 'Active Input' section). I do appreciate you responding though, if Chris hadn't of responded then I'm sure you'd have pointed me in the direction of Active Inputs.

    @ChrisIceBox - Once again thanks for the great advice, I feel a bit stupid that it was in the manual all along. I'm so used to searching the forum and when the answer doesn't pop up then I ask the question however considering that the answer was in the manual all along it makes sense that no one else had asked the question on the forum! Haha, sorry for that. Thanks again though.
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.