Page 1 of 1

Space to Continue

Posted: Thu Feb 01, 2018 1:58 pm
by Caidran
Hello,

I've been looking at ways to replace the continue button with a space bar press and unfortunately, I'm coming up short.
I've tried to simulate a left click upon a space bar press but having little luck with that, the idea there was to just make the continue button invisible and cover the screen.

I'd like to try and get it working in a way that when you press the space bar the script that runs when clicking the continue button would run as usual. Is this feasible within dialogue system and if so, is it native or will I be mashing around in the code? (which is fine)

Cheers :)

Re: Space to Continue

Posted: Thu Feb 01, 2018 6:49 pm
by Tony Li
Hi,

There are two ways to do this:

1. Inspect your dialogue UI (assuming you're using Unity UI), and tick Auto Focus. This checkbox is near the bottom of the inspector. When ticked, the dialogue UI will automatically navigate to the continue button when showing a subtitle, and it will automatically navigate to the first response button when showing the response menu. Then the player can just press the Submit input, which by default is mapped to the Space and Return keys.

2. Or add a UI Button Key Trigger component to the continue button, and set the Key to Space. This sets the Space key as a hotkey that, when pressed, clicks the button.

You can also make the continue button cover the whole screen and set the color's alpha to 0 to make it invisible.

Re: Space to Continue

Posted: Fri Feb 02, 2018 11:49 am
by Caidran
UI button key trigger was exactly what I was looking for.

Thanks for your help :)