Highlighted Color Disappears When Mouse Moved

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
baxta86
Posts: 17
Joined: Wed Jun 30, 2021 7:53 am

Highlighted Color Disappears When Mouse Moved

Post by baxta86 »

I am using the new input system and have set up a conversation with an NPC which gives the player two choices to respond with. That all works fine, I can select the response using up and down buttons on the D-Pad or stick on the controller, and it also works when I use the keyboard up and down arrows or W and S keys to select my response.

PreMouseMove.JPG
PreMouseMove.JPG (10.53 KiB) Viewed 285 times
However, if I move the mouse to select an answer, the answer which is currently selected (highlighted) loses its highlight and only highlights when the mouse hovers over it. Then if I try and use the keyboard buttons or controller, neither response is highlighted anymore and I cannot tell which answer I have selected.

AfterMouseMove.JPG
AfterMouseMove.JPG (15.07 KiB) Viewed 285 times
Ideally I'd like to highlight an answer when the mouse hovers over it, but if the mouse is moving or not highlighting an answer, it remains highlighted so the user can select an answer with the controller or keyboard buttons.

**I have tried using different dialog UI's and all have the same results
baxta86
Posts: 17
Joined: Wed Jun 30, 2021 7:53 am

Re: Highlighted Color Disappears When Mouse Moved

Post by baxta86 »

**Found the solution!**

I just had to enable 'Always Auto Focus' on the 'Input Device Manager' Script on the Dialogue Prefab asset :D
User avatar
Tony Li
Posts: 22161
Joined: Thu Jul 18, 2013 1:27 pm

Re: Highlighted Color Disappears When Mouse Moved

Post by Tony Li »

Hi,

Yup, that's the solution. This is by design. If you switch to using the mouse, it will no longer auto-focus buttons unless Always Auto Focus is true. Often, in mouse-driven games, designers don't want to auto-focus one of the responses because it might subtly prompt the player into choosing that response instead of considering all of the responses equally.

The Dialogue Manager's Input Device Manager component can automatically switch back to Joystick mode, in which it will keep a button focused. To do this, it checks the inputs specified in the Joystick Buttons To Check and Joystick Axes To Check. Since you're using the new Input System package, if you add anything to those lists, make sure to register them in your registration script (InputDeviceManager.RegisterInputAction).
Post Reply