Author Topic: UI Key Navigation Problem — NGUI 3.10.1 and Unity 5.4.1  (Read 1525 times)

Jason RT Bond

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UI Key Navigation Problem — NGUI 3.10.1 and Unity 5.4.1
« on: September 19, 2016, 10:11:00 AM »
I've been using NGUI for some time in a project (launched some time ago, doing maintenance updates) and our main menu and config menu are built using the UIKeyNavigation component. Everything's been working until recently I upgraded NGUI to 3.10.1 and Unity to 5.4.1. Now, the menus don't navigate correctly. The actual behaviour is strange and I'm not sure I can give an exact description but it's something along these lines:
• One has to hold up/down on the joystick or keyboard and wait a second before the next item becomes highlighted. (We use only vertical.)
• The highlighted element seems to snap back to the previous element regularly

About our setup:
• Essentially we have two panels with a series of buttons as children. Only one panel is on at a time.
• Each button's UIKeyNav component explicitly defines the next button up or down in the "override" section.
• The UICamera defines the Y axis as "Uni_Vertical", which is our custom axis fed by several inputs (joysticks & keyboard). We have this defined because we ALSO have axes for each input separately (to accomodate multiplayer).
• We have a couple helper scripts attached to buttons but disabling them does not solve the issues above.

Although this is a game already launched, we'd love to keep it current a little longer as we provide updates every now and then (and some platforms, like iOS, require you to stay on the tech treadmill or you can't submit updates :P).


Please let me know if you have any thoughts on what might be the issue or what avenue I might be able to investigate.

Cheers!

diederik

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 31
    • View Profile
Re: UI Key Navigation Problem — NGUI 3.10.1 and Unity 5.4.1
« Reply #1 on: September 19, 2016, 01:26:19 PM »
Hi!

My initial thought is that it might have something to do with (default) Input Axes that have appeared in your InutManager due to the Unity update. Maybe these have a different sensitivity or gravity than the ones you had set up?

I'm sure you have checked the axes that are defined in the UICamera are the correct ones?

Diederik / Xform

Jason RT Bond

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UI Key Navigation Problem — NGUI 3.10.1 and Unity 5.4.1
« Reply #2 on: September 19, 2016, 06:59:58 PM »
A little more info: I reverted NGUI to ver 3.8.2 and the issue is resolved, even staying with Unity 5.4.1. So it would seem to be an issue with NGUI changes between 3.8.1 and 3.10.1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: UI Key Navigation Problem — NGUI 3.10.1 and Unity 5.4.1
« Reply #3 on: September 20, 2016, 12:58:38 AM »
I second what diederik said. Check your input axes. I'm guessing you have it set so that the value goes from 0 to 1 very slowly when you press a button. It's great for simulating slow acceleration, but it's awful for UI navigation. A certain threshold has to be reached before the UI navigation is performed.

You can always create a new project and import NGUI into it (along with the examples), and test the keyboard navigation there.