Page 1 of 1

Highlighted Color Disappears When Mouse Moved

Posted: Thu Jul 01, 2021 5:36 am
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 283 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 283 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

Re: Highlighted Color Disappears When Mouse Moved

Posted: Thu Jul 01, 2021 7:02 am
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

Re: Highlighted Color Disappears When Mouse Moved

Posted: Thu Jul 01, 2021 8:31 am
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).