Page 1 of 1

Continue button highlight

Posted: Wed May 17, 2023 6:28 am
by Oskar
In my dialogue I have a custom continue button that is highlighted on hover; however, when there's a line from NPC with the continue button shown after it, then after that, a dialogue entry from other NPC and another continue button placed after that, the continue button doesn't highlight, even if it does so the first time. I have custom sprite images for the normal and highlighted continue button.

This is the sequence I use to activate the button:

SetActive(ExternalContinueButton)@Message(Typed);
required @Message (Continued);
required SetActive(ExternalContinueButton, false)@Message(Continued);

Below is a screen crab from the game. Where the red line is drawn, the first working continue button was shown and currently visible is the second one, meaning the one that doesn't get highlighted when hovered over. Any idea on how to fix this?

Re: Continue button highlight

Posted: Wed May 17, 2023 12:21 pm
by Tony Li
Hi,

Is the continue button still selected even if Unity UI isn't drawing it in the highlighted visual state? To check this, keep an inspector view on the EventSystem GameObject while you're playing. The bottom of the inspector will show which button Unity UI has currently selected.

If it's not selected, inspect your Standard UI Subtitle Panel component. Assign the continue button to the First Selected field, and set Refresh Selectables Frequency to 0.5. This assumes your continue button is in the subtitle panel's hierarchy.