Page 1 of 2

New Input System + Dialogue System Issue

Posted: Sun Mar 20, 2022 3:58 pm
by PayasoPrince
Hi Tony,

Hope you have been well!

I recently upgraded to the new input system and enabled support for it in the pixel crushers welcome window.

Though for some reason, when ever dialogue is triggered I am receiving the following alert:

Code: Select all

KeyNotFoundException: Cannot find control 'keypadenter' as child of 'Keyboard:/Keyboard'
UnityEngine.InputSystem.InputControl.get_Item (System.String path) (at Library/PackageCache/com.unity.inputsystem@1.3.0/InputSystem/Controls/InputControl.cs:417)
PixelCrushers.InputDeviceManager.DefaultGetKeyDown (UnityEngine.KeyCode keyCode) (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/InputDeviceManager.cs:482)
PixelCrushers.InputDeviceManager.IsKeyDown (UnityEngine.KeyCode keyCode) (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/InputDeviceManager.cs:158)
PixelCrushers.UIButtonKeyTrigger.Update () (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/UIButtonKeyTrigger.cs:53)
How/where can I resolve this issue? :shock:

Re: New Input System + Dialogue System Issue

Posted: Sun Mar 20, 2022 7:56 pm
by Tony Li
Hi,

When that error occurs, look for a UIButtonKeyTrigger component in whatever scene(s) are open. An easy way to do this is to enter "t:UIButtonKeyTrigger" in the Hiearchy's search bar. Find the one whose Key dropdown to set to KeypadEnter.

Then exit play mode, locate that same UIButtonKeyTrigger, and set Key to None. Set Button to the name of an input action that you've registered with the Dialogue System's Input Device Manager. (The separate Input_Device_Manager_Manual.pdf explains how to register input actions. There's a video tutorial, too.)

Re: New Input System + Dialogue System Issue

Posted: Sun Mar 20, 2022 9:09 pm
by PayasoPrince
Hey thanks for the reply Tony.

Where can I find this manual?

Also, in regards to registering my actions-
Should I be ADDING to the existing DemoInputRegistration or should I make my own class identical to it?
How can I reference my own Action map similar to how you call "controls.DemoActionMap"?
Image

Re: New Input System + Dialogue System Issue

Posted: Sun Mar 20, 2022 10:02 pm
by Tony Li
PayasoPrince wrote: Sun Mar 20, 2022 9:09 pmWhere can I find this manual?
If you're ever looking for something in the project, try typing its name into the Project view's search bar. In this case, the PDF is in Plugins / Pixel Crushers / Common / Documentation.
PayasoPrince wrote: Sun Mar 20, 2022 9:09 pmShould I be ADDING to the existing DemoInputRegistration or should I make my own class identical to it?
How can I reference my own Action map similar to how you call "controls.DemoActionMap"?
Create your own similar class. When you create your action map, configure it to auto-generate a C# script. The manual and video tutorial should clarify.

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 2:02 pm
by PayasoPrince
Hey Tony,

I went through both the manual and the video and my UI Button Key Trigger is now working with my registered Action.
Thanks! :D

However, for some reason, hitting Enter or Clicking with the mouse ALSO triggers the button. :oops:
I have all Keys set to none and can't find a setting where this is enabled. Can you please assist me with removing this? :?:

I ONLY want the action I specify in the UI Button Key Trigger to trigger the button and continue the dialogue.

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 2:16 pm
by Tony Li
Hi,

Inspect the Dialogue Manager, and untick Always Auto Focus. Then inspect your subtitle panel. If the Continue Button is assigned to the Standard UI Subtitle Panel's First Selected field, deselect it.

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 5:17 pm
by PayasoPrince
Tony Li wrote: Mon Mar 21, 2022 2:16 pm Hi,

Inspect the Dialogue Manager, and untick Always Auto Focus.
I'm having trouble finding where the "Always Auto Focus" setting is. I can't seem to find it on my Dialogue Manager GameObject.
Tony Li wrote: Mon Mar 21, 2022 2:16 pm Then inspect your subtitle panel. If the Continue Button is assigned to the Standard UI Subtitle Panel's First Selected field, deselect it.
Can you confirm that I did this correctly?

Here is where my ContinueButton and FastForwardButton are:
Image

I inspected the NPC Subtitle Panel and set it to none like this:
Image

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 5:19 pm
by Tony Li
Hi,

Does your Dialogue Manager have an Input Device Manager component? If so, the Always Auto Focus checkbox is on it.

Your subtitle panel setup looks OK.

Also, on your UI Button Key Trigger component, tick 'Skip If Being Clicked By Submit'.

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 6:18 pm
by PayasoPrince
Hmm, mouse clicks and the enter key are still triggering the continue button. :(

- I removed the Input Device Manager component from my Dialogue Manager already so its not ticked.
- Checked off Skip If Being Clicked By Submit (I also tried it unchecked)

What else should I do?

Re: New Input System + Dialogue System Issue

Posted: Mon Mar 21, 2022 8:22 pm
by Tony Li
The Input Device Manager component is necessary to handle the Input System package integration. Can you add it back and keep Always Auto Focus unticked?

Also tick the UI Button Key Trigger's Skip If Being Clicked By Submit checkbox. [EDIT: I previously said "UNtick" accidentally]