Page 1 of 2
Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 9:35 am
by Jack_Development
Hi all!
I'm currently working on implementing a system from the VN Template Standard Dialogue UI, and I am trying to get the basic setup for the dialogue system complete. However, I am struggling to get the choice selection to properly move and select the options with either the keyboard or gamepad.
Auto Focus is already being enabled and disabled, based on the InputDeviceManager OnKeyboard, OnJoystick, OnMouse, etc. so the options are being highlighted, however when attempting to select or navigate the choices, nothing seems to be working.
I would appreciate any advice on where to look or what settings to investigate to resolve this issue.
Many thanks.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 11:03 am
by Tony Li
Hi,
Inspect your EventSystem GameObject. You might need to click the button to switch it from Unity's built-in input manager to the Input System package's InputSystemUIInputManager.
Then, during play, keep an inspector view on the EventSystem. The bottom of the inspector will show the current selection. Verify that it's one of the response buttons when the response menu is open.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 11:11 am
by Jack_Development
Hi Tony,
The EventSystem has already been updated to the new Input System, and is being used across the rest of the project, as well as being used for the Continue, and Interact buttons with the Dialogue System already, it's just the navigation and confirmation that doesn't seem to be working.
In regards to viewing the EventSystem in the Inspector, it is indeed showing the correct GameObject selected when using the keyboard and controller.
Is there something that needs to be configured for navigation with the new input system in one of the scripts?
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 11:17 am
by Tony Li
As long as the EventSystem shows that a response button is selected, navigation is entirely out of the Dialogue System's hands.
You can inspect the response buttons to make sure their Navigation sections look correct, but apart from that I suggest checking the input actions assigned to the EventSystem's InputSystemUIInputModule. Also check the Console window for any errors or warnings.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 11:30 am
by Jack_Development
Hi Tony,
Thanks for your comments and response!
I've found that the "Send Navigation Events" toggle in the Events System was being disabled at runtime for some reason?
I've added some code to reenable and disable these events at the start and end of conversations, and that seems to have fixed the issue.
Once again, thanks for your support!
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 12:08 pm
by Tony Li
Hi,
Are you using More Mountains' Inventory Engine? It turns off navigation events when its inventory UI isn't open.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 1:29 pm
by Jack_Development
Hi Tony,
Yes, you are correct, I am using the Inventory Engine, the "Input Only When Open" setting was enabled, which is what was disabling the events at runtime.
I've disabled those settings in the canvases for the inventories, and am putting in failsafes for that to prevent the loss of input by disabling the inventory toggle during dialogue.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 2:39 pm
by Tony Li
There's also an
Inventory Engine integration package that has some useful utility scripts.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 2:52 pm
by Jack_Development
Hi Tony,
Are there any specific pages on the documentation for writing custom lua scripts for calling functions on the Inventory Engine systems? I am looking to open and close the inventories during the conversation, and can't seem to find support that.
Re: Gamepad/Keyboard Support - Choice Selection
Posted: Fri Aug 16, 2024 3:03 pm
by Tony Li
The integration itself doesn't include those functions, but here's the reference for registering your own C# methods with Lua:
Registering C# Methods With Lua
And here's the reference for the functions it does include:
Inventory Engine Lua Functions