- Home /
Gamepad menu navigation with uGUI not working as expected.
I have a simple menu blocked out with uGUI buttons, but I can't seem to navigate them using a gamepad's left analog stick. I've tested this with multiple controllers, and ensured that I'm getting axis input just fine. I have the Event System's 'First Selected' field set to one of my buttons, and using the keyboard or the gamepad's d-pad works just fine. And in fact if you hold the left analog stick, the selection will change after the given repeat delay time (from the standalone input module) has elapsed, but tapping in any direction once does nothing. Is anyone else seeing this, or have any ideas what's happening?
Answer by David_Knopp · Oct 22, 2015 at 10:57 PM
After some digging around in ILSpy, I've tracked down the issue. In the BaseInputModule (which the StandaloneInputModule derives from), there is a function called 'DetermineMoveDirection' that is used to set the direction for the move event that gets sent out when the left stick is tilted. But most of the time, the stick's vector makes its way to this function before its magnitude is greater than a dead zone (which looks like it's hard-coded at 0.6). And there's some checking being done that is preventing it from getting checked later when its magnitude is greater than the dead zone, therefore never getting sent out with a proper move direction.
Long story short, it looks like a bug to me and I've logged it. For anyone else having this problem, you can bypass it by creating a custom InputModule.
Your answer
Follow this Question
Related Questions
New dropdown menu sample 3 Answers
Button highlighted a pushable without touching it 0 Answers
How change speed of scrollbar (ui) with mousewheel 0 Answers
[5.4.1f1] After clicking on a Button, pressing Space fires the Button.onClick event 2 Answers
How would you go about linking to projects together, and adding a menu? 1 Answer