Forum rules - please read before posting.

Use inventory with gamepad

I'm new to Adventure Creator, and so far I'm having a lot of fun!

I'd like to control everything with the gamepad. I managed to control a character and the main menu thanks to Rewired/AC support script and AC direct movement / keyboard and controller. I locked and hided the mouse. I'm happy this all works. 

Now I did read here I had to switch to Unity UI to use the inventory with a gamepad, so I followed the tutorial to set up an to AC linked inventory created with Unity UI. With a mouse this works as well. I'd like to know how to control it with a gamepad though.

I'd like to build it so that when I push the Y button on my gamepad, the inventory slides on screen, and I'll be able to choose an item with the control stick and A button. It's ok if the character freezes, but background animations should continue. Then with the Y button the inventory slides off screen again.
 
I hope to find some tips here that'll get me in the right direction. Basically what I'd like to know can AC do something more for me here or should I really just dive in and create my own scripts for these things?  

Comments

  • Welcome to the community, @zinvolspel.

    No scripts should be necessary, but that's still an option if you prefer.

    To clarify: "AC" menus are still able to handle direct-navigation, but Unity UI has more flexibility in general.  Each of the default Menus provided by the New Game Wizard also have a Unity UI counterpart, which can be activated by changing your default Menu's Source field to Unity Ui Prefab.

    In order to directly-navigate a Unity UI-based Menu, however, you must specify which element is first selected when the Menu turns on.  This can be done from the bottom of the Menu's list of properties in the Menu Manager - or by using the Menu: Select element Action.

    Additionally, unless your Menu pauses the game when turned on, you will also have to allow for direct-navigation of it using the Engine: Manage systems Action, which has its own Direct-control in-game Menus option.  For more on this topic, see the Manual's "Navigating menus directly" chapter.

    As for having your gamepad toggle the Inventory menu, you have two options:
    1. Set the Menu's Appear type to On Input Key, and (using Unity's Input Manager) map your gamepad button to the input defined in the Menu.
    2. Define Active Inputs that respond to the gamepad button and use the Menu: Check state / Menu: Change state Actions to toggle the menu on/off accordingly.
    Both of these techniques are covered in the 3D Tutorial here and here respectively.

  • edited July 2018
    Thank you very much for your thorough answer. Because of it I have made some progress already, I can now open up (slide in/out) and close the inventory with my gamepad Y button. 

    Because I've been a little short on time these days I haven't found the time yet how figure out how to at this Engine: Manage systems Action. See I'm quite green xD

    But I will get there, and when I'll have it all working I'll certainly come back to this post. I just couldn't wait to say.. Thanks! :D 
  • You're welcome!  To be clear, the Engine: Mange system Action will display an additional Control in-game Menus option provided that your Movement method is set to Keyboard Or Controller.
  • Because of your tips I managed to do all that I asked for in my post. Now it's time for me to gain a little more control so I can tweak some more details within these interactions. Making it look and feel nice, but that's another story :) Thank you very much for getting me on my way! :D
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.