Hi i am having a problem with the UI that when i move the mouse it will highlight the button when i move the mouse but the problem is when i press the up and down arrow or the dpad when i put the mouse in a position another button, the highlight position will immediately move to the mouse position (like in the video). Can anyone guide me to fix it?
Hey there @Nhan226! Depending on how you’d like it to react, I’d recommend hiding the mouse when a controller is in operation and/or moving it to the focused UI element or off screen. It’s easier than creating a new button class and intercepting the mouse hovers or forcing focus elsewhere.
Relevant nodes: Set Mouse Position and Show Mouse Cursor. You can find them both when pulling from a player controller reference. You’ll have to define these calls based on your UI hovered/focused however.
the problem is that i am using this function to select each option in the above widget. So what do you mean if I want to fix this bug I don’t use this function and have to separate each input?
Ahhh this method should still work without a total refactor, though if you’re handling focus manually, you could just make a child class and override the hover focus whenever the mouse isn’t the primary input as well if you’d prefer.
I can’t imagine the code direction can you give me an specific example. Thank you!