Select response with number keys
Select response with number keys
Hello,
Does anyone know if it is possible to select responses by using number keys rather than having to click the response?
Not averse to having to add some custom scripting but I'm hoping I've just been a bit dense and it is actually really simple and already part of the package
Cheers
Does anyone know if it is possible to select responses by using number keys rather than having to click the response?
Not averse to having to add some custom scripting but I'm hoping I've just been a bit dense and it is actually really simple and already part of the package
Cheers
Re: Select response with number keys
Hi,
It's easiest if you're using Unity UI. Inspect your dialogue UI, and tick Dialogue > Response Menu > Autonumber > Enabled:
It numbers responses from 1. You can change the appearance by editing the Format field. If you want to assign different input buttons/keys, define your response buttons explicitly, assign them to the Buttons list, and add a UI Button Key Trigger component to each button. Devs will often do this for console games where they might assign responses to the A, B, X, and Y gamepad buttons.
It's easiest if you're using Unity UI. Inspect your dialogue UI, and tick Dialogue > Response Menu > Autonumber > Enabled:
It numbers responses from 1. You can change the appearance by editing the Format field. If you want to assign different input buttons/keys, define your response buttons explicitly, assign them to the Buttons list, and add a UI Button Key Trigger component to each button. Devs will often do this for console games where they might assign responses to the A, B, X, and Y gamepad buttons.
Re: Select response with number keys
Thanks Tony, just had a chance to test. Works perfectly.
Re: Select response with number keys
Great! Thanks for letting me know.
Re: Select response with number keys
Hello,
Just bumping this up rather than create a new thread as it's related.
I'd like to be able to select response options with the numpad as well as the regular number keys, is this possible natively through Dialogue System or will I be looking to add the key press down entries for the numpad to the regular number keys somehow?
Cheers
Just bumping this up rather than create a new thread as it's related.
I'd like to be able to select response options with the numpad as well as the regular number keys, is this possible natively through Dialogue System or will I be looking to add the key press down entries for the numpad to the regular number keys somehow?
Cheers
Re: Select response with number keys
Good idea! I just added that to Unity UI Dialogue UI. You can download the updated Unity UI Support package on the Dialogue System Extras page. Expand Dialogue > Response Menu > Autonumber, and tick Numpad Hotkeys.
If you're using Text Mesh Pro, let me know. I'll need to a similar checkbox to it. Combining Unity UI and Text Mesh Pro support into a single Standard Dialogue UI is on the roadmap, but it's not ready yet.
If you're using Text Mesh Pro, let me know. I'll need to a similar checkbox to it. Combining Unity UI and Text Mesh Pro support into a single Standard Dialogue UI is on the roadmap, but it's not ready yet.
Re: Select response with number keys
Hi Tony,
Superb - thank you. That works perfectly as always.
Superb - thank you. That works perfectly as always.
Re: Select response with number keys
Happy to help!
Re: Select response with number keys
Hi Tony, it seems that the numbering is reversed. The first entry is "3", second entry is "2", last entry is "1", etc. Please help take a look. Thanks!
Re: Select response with number keys
Hi @zengusan,
Are you auto-numbering instantiated buttons or explicitly-defined buttons? Instantiated buttons are created from the Button Template. Explicitly-defined buttons are assigned to the Buttons list. If you're using explicitly-defined buttons and alignment is set to ToLast, buttons are added in reverse order. In this case, you may want to set it to ToFirst instead and set up a layout group that aligns the buttons to the bottom of a panel.
Are you auto-numbering instantiated buttons or explicitly-defined buttons? Instantiated buttons are created from the Button Template. Explicitly-defined buttons are assigned to the Buttons list. If you're using explicitly-defined buttons and alignment is set to ToLast, buttons are added in reverse order. In this case, you may want to set it to ToFirst instead and set up a layout group that aligns the buttons to the bottom of a panel.