Can't use controller input for Continue Button when Scrollbar Active

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
EffieArtoria
Posts: 9
Joined: Mon Mar 08, 2021 6:45 pm

Can't use controller input for Continue Button when Scrollbar Active

Post by EffieArtoria »

Hi,

I'm trying to put a scroll rect on the Subtitle Panel in the JRPG Template Standard Dialogue UI. I've more or less gotten there, but there's one issue. Whenever the scrollbar is visible I can't use the confirm button on controller to continue. I can controll the scrollbar with analogue stick, but I have to use the mouse to manually click the Continue button. When the dialogue is too short to scroll, everything behaves fine, controller input works a charm.

Not sure what details to include - I've largely followed the example in this thread ( https://pixelcrushers.com/phpbb/viewtop ... 233#p14233) to get the scrolling effect to work, so I have Scroll Rects, Standard UI Subtitle Panel, UI Scrollbar Enabler, etc.

Any idea what I might need to do to get this to play nice?
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can't use controller input for Continue Button when Scrollbar Active

Post by Tony Li »

Hi,

It sounds like the scroll rect is getting input focus -- that is, in Unity UI EventSystem terms, it's "selected". To see what UI element the EventSystem has selected, keep an Inspector view open on the EventSystem GameObject. At runtime, the Inspector will show what item, if any, is selected.

Try assigning your continue button to the Standard UI Subtitle Panel's "First Selected" field.
EffieArtoria
Posts: 9
Joined: Mon Mar 08, 2021 6:45 pm

Re: Can't use controller input for Continue Button when Scrollbar Active

Post by EffieArtoria »

Thanks! That enables the continue button and the typical behaviour.

However, I now can't control the scrollbar with the controller when it appears. Is there a straight forward way to scroll and confirm at the same time? If there's no easy answer I'm fine leaving it as is- I'm not intending for a ton of scrolling to happen, and this way the player can still advance messages with the controller. Just worth asking.

The UI really takes a lot of getting used to! I'm deeply appreciative of the UI prefabs you include, and your support. You're a saint!
User avatar
Tony Li
Posts: 22110
Joined: Thu Jul 18, 2013 1:27 pm

Re: Can't use controller input for Continue Button when Scrollbar Active

Post by Tony Li »

Hi,

Here are two options:

1. Set the subtitle panel's Standard UI Subtitle Panel component > Focus Check Frequency and Refresh Selectables Frequency to zero. This will prevent the continue button from "stealing" back focus. This way you can navigate input focus to the scroll bar. Then add a UI Button Key Trigger component to the continue button, and set the Button Name to Submit.

2. Or keep each line short enough that it doesn't need to scroll. It's easier on the reader's eyes, too.
Post Reply