Search Unity

Bug Automatic UI navigation not working in build

Discussion in 'Input System' started by OriolSC, Jun 4, 2021.

  1. OriolSC

    OriolSC

    Joined:
    Oct 7, 2019
    Posts:
    9
    I have found what may be another Input System bug. I am aware that there are a lots of thread regarding issues with UI buttons not working. However, none of them have experienced or stated anything similar to what has happened to me.

    So my game allows two different controls: keyboard + mouse and a Xbox controller.
    The UI of the different scenes works mostly the same, where the current selected button will be color tinted and the others will stay the same.

    Mouse controls, which basically are point & click, work perfectly fine since they do not use the UI button navigation. The problem appears with either keyboard or Xbox controller but I am quite sure that any other input method relying on the UI navigation, will experience the same.

    Basically the issue is that I can submit the current selected button but when I try to change the selected button using the Navigate/Move event, nothing happens. So I am always stuck on the first button without being able to change to any other.

    The problem could be fixed using manual navigation instead of an automatic one, but this is nonetheless a bug. Also, as the thread title says, this is only an issue in the build versions. The Unity Editor works properly.

    upload_2021-6-4_9-35-39.png
     
    Last edited: Jun 4, 2021
  2. OriolSC

    OriolSC

    Joined:
    Oct 7, 2019
    Posts:
    9
    While I was making the change from automatic to manual navigation I came up with a simple solution. I made the PlayerInput invoke Unity events and I created a fast function to control manually the UI navigation since I only had 2 buttons on the scene.

    upload_2021-6-4_13-5-35.png

    What is curious, is that after I finished the function, it worked once again fine in the editor but not in the build. I added a debugger to read what was the problem and I saw that a very similar issue from a post that I created before, happens here also. It is not exactly the same issue but it is likely related.

    Anyways, I printed the context and I saw that in the editor I received the proper values like (0f, 1f), (-1f, 0f) and all that. Somehow, for the build it was not like that. I always received (0f, 0f) regarding which buttons I pressed, always (0f, 0f). The solution that I came up with, is simply to change a parameter of the corresponding Input Action of the Navigate/Move event. What needs to be modified, is the 2D Vector Composite mode where rather than the default Digital Normalized I changed it to Analog.

    This fixed the problem and the automatic navigation worked. So there is no need to implement a manual UI button navigation. However, this is a potential bug that needs to be solved.
     
    Last edited: Jun 4, 2021