Space to Continue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Caidran
Posts: 20
Joined: Wed Jan 03, 2018 5:02 pm

Space to Continue

Post 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 :)
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Space to Continue

Post 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.
Caidran
Posts: 20
Joined: Wed Jan 03, 2018 5:02 pm

Re: Space to Continue

Post by Caidran »

UI button key trigger was exactly what I was looking for.

Thanks for your help :)
Post Reply