Search Unity

Keyboard navigation is going to items in non-interactable CanvasGroup

Discussion in 'UGUI & TextMesh Pro' started by mentics, Feb 1, 2020.

  1. mentics

    mentics

    Joined:
    Aug 18, 2015
    Posts:
    10
    I want to have a "popup dialog" sort of UI element come up and make all the other UI non-interactable during that time. I put it in one CanvasGroup and everything else in a different CanvasGroup and deselected the "interactable" on all the CanvasGroups except the one containing the UI components I wanted. However, when using the cursor keys, it is still navigating to components under the non-interactable CanvasGroups. Is there something else I need to do to restrict navigation to a certain set of components?

    Using version: 2019.3.0f5
     
  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    Is the "Navigation" of your components set to "Automatic"?

    Are you sure that the components are actually non-interactable? Canvas Groups have an "ignore parent" checkbox that could potentially cause their children to be interactable even when a parent Canvas Group is set to non-interactable.

    When I did some basic tests (in an older version of Unity) I believe that disabling a Canvas Group prevented those elements from being selected by automatic navigation, but did NOT de-select the previously-selected component (even though it was now disabled) or automatically select a new one in the newly-enabled group. I ended up writing a manager that would explicitly change the selection whenever a group changed. However, once a new thing was selected, navigation would only go to other interactable controls.