Forum rules - please read before posting.

Direct Inventory Navigation with Gamepad (new input system, no mouse, no cursor)

Hey everybody,
hey @ChrisIceBox!

I'll admit I'm having a bit of trouble scripting my gamepad support to use AC completely without mouse, cursor or keyboard, utilizing the new input system. My menus are Unity UI prefabs.

  1. Now I just found the next piece of the puzzle: enabling "direct-nav in-game menus" with the "Engine: Manage Systems" action. Great, but how can I do this via script? ChatGPT doesn't know xD

  2. Also, at the moment I'm using an Event System prefab that has the components "Optional Mouse Input Module" for mouse control and "Input System UI Input Module" for gamepad control attached to it and I have to enable/disable them respectively at runtime. Is this the way to go?

  3. Is there some guide or tutorial on this topic? After reading the chapter about direct control in the menu, I still have lots of questions. Because the next thing will be using items with multiple interactions, combining items, using items with the environment... is all of this already possible with just AC? What do I have to script myself?

This is a really important part of my game and it already took me many hours just to arrive at this point so I'm humbly asking for your help. Thank you!

Comments

  • Now I just found the next piece of the puzzle: enabling "direct-nav in-game menus" with the "Engine: Manage Systems" action. Great, but how can I do this via script? ChatGPT doesn't know xD

    You can enable direct navigation of in-game menus either with the Engine: Manage systems Action, or with the code line:

    KickStarter.playerInput.CanKeyboardControlMenusDuringGameplay = true;
    

    Also, at the moment I'm using an Event System prefab that has the components "Optional Mouse Input Module" for mouse control and "Input System UI Input Module" for gamepad control attached to it and I have to enable/disable them respectively at runtime. Is this the way to go?

    It's best to rely on a single module. Are you using AC's Input System integration package?

    Is there some guide or tutorial on this topic? After reading the chapter about direct control in the menu, I still have lots of questions. Because the next thing will be using items with multiple interactions, combining items, using items with the environment... is all of this already possible with just AC? What do I have to script myself?

    It should all be possible with AC + the integration package - but there will be an update to this package once v1.82 is released, that simplifies installation and improves gamepad support for UI objects. You're welcome to PM me if you'd like to be involved in testing.

  • Be honest, how many people are behind "ChrisIceBox", because your support is out of this world! Thank you!

    Yes, I'm using the Input System Integration Package. Great, sure, I will PM you – after all your help I also feel like I would like the help out a bit, even if it is just by testing and giving technical feedback.

    When you say, it's best to rely on a single module, how can I do that? At the moment it looks like I have to use one for mouse control and one for gamepad control, but maybe I still don't understand crucial aspects about the systems and to be honest my experience with gamepad UI controls even without AC, just in Unity, is about zero, so I also have a bit of trouble seeing what has to do with AC and what is just Unity and how to combine the functionality.

    At the moment, I can cycle through the items, but when I press the "Submit" button on my gamepad, nothing happens, but maybe some of my code is interfering.

    My problem is also that I don't know what is supposed to happen or how the whole thing should work. For example, how would I make combining items with the environment work? Or with other items? Normally I would click an item and then the environment hotspot, but how would that look with just the gamepad?

  • Thanks for the offer - I will send you files you test shortly.

    but maybe some of my code is interfering.

    What code, specifically?

    When you say, it's best to rely on a single module, how can I do that?

    Input System has its own Input System UI module, The updated integration includes a ready-made EventSystem prefab with this module pre-configured.

    Normally I would click an item and then the environment hotspot, but how would that look with just the gamepad?

    Are you using a simulated cursor when using the gamepad? When "clicking" in the scene (not on UI objects), "InteractionA" is the input to use.

  • I would like to achieve this without any cursor, not even simulated and it is totally fine if I have to code this on my own, I just don't want to code functionality that is already there :)

    Regarding code that might interfere, I have code to cycle through inventory items, but maybe it is not necessary and there might me conflicts, I'm just right in the middle of coding so that is a possibility, but I would generally just like to understand what is possible with AC and what I have to do myself.

  • I can only speak generally without knowing the specifics of your game, but AC can be used on its own to have a gamepad-only game with no simulated cursor. You'll need to make use of "Keyboard Or Controller" input as well as the direct-navigation of Menus - see the Manual chapters "Keyboard or controller input" and "Navigating menus directly" for details.

  • edited November 2024

    I have read the Manual chapters but since the input system integration is an additional addon, I suspect my problems are not discussed there and I believe I did everything that is mentioned.

    What I don't understand: when I don't specify an Event System prefab in AC, one gets created with "Optional Mouse Input Module" and "Base Input" components and gamepad works for submitting interactions but I can't navigate the menus. But when I provide my own prefab with just the single "InputSystemUIInputModule", I can navigate menus, but I can't use the gamepad to submit an interaction.

    Maybe it is also important to mention that I'm switching between mouse and gamepad mode and I change AC settings at runtime. Maybe there are relevant settings that can't be set at runtime that must be set in the inspector I don't know about?

    Sorry for all the confusion but I'm having a hard time with this and it's a very important feature of my game so I have to do this the right way.

  • Have you tried the updated package I sent you? It now uses a template that will install a custom Event System prefab in your Menu Manager.

  • I created a new project to take a look at it. Should the input system integration from the package you sent me work with v1.81.7?

    In my new project with the packages you sent me, I set the event system prefab in the menu manager. I tried navigating the menu and when I select an element in the Pause Menu and click the "Submit" button on my gamepad, it deselects the element and nothing happens. Maybe I forgot to make a crucial configuration? I set all "directly-navigate" flags to true and in the pause menu, the "automatically select first visible element" is also set to true.

  • Recreated. Looks like there's an issue with direct navigation with the test package - a knock-on effect of fixes made to the simulated cursor handling.

    Thanks for the feedback, I'll look into it further.

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.