Author Topic: UIKeyNavigation looses focus when gameobject gets activated  (Read 2322 times)

malo88

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 9
    • View Profile
UIKeyNavigation looses focus when gameobject gets activated
« on: October 19, 2017, 06:07:37 AM »
Hi, I don't understand what I'm doing wrong but apparently UIKeyNavigation is not working correctly. Every time I'm using the controller (xbox pad or whatever) and a dialog pops up, the button OK in that dialog has no focus and the user is stuck on that dialog. Basically the dialog Ok button has an UIKeyNavigation with StartsSelected set to true and the Explicit flag. I tried also to put it with Explicit and set also all the left,right,down,up so that no one is null, but still it has no focus. (NOTE: everything is set by Inspector, not by code). I'm setting it to explicit because under the dialog there are the others gui components which become not selectable with a darkener panel over them but you could navigate on them because they are still active in the gui, so if I don't set Explicit the user will be able to navigate on them when the dialog is up.
Thanks for the help guys!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIKeyNavigation looses focus when gameobject gets activated
« Reply #1 on: November 06, 2017, 06:58:12 AM »
Are you using controller-exclusive input, or are you accepting input from other sources as well? If only controller input is allowed, then it shouldn't be possible to not have something selected at all times. Have you checked the controller input example scene to see how it behaves for you? And last but not least, did you make sure your button's collider is actually enabled? UIKeyNavigation will not select an object with a disabled collider.

The Explicit constraint has no effect on the initial selection.