Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Automatic Navigation Changes Canvases When Using Screen Space - Camera

Discussion in 'Scripting' started by Ian_Sowell, Jul 5, 2023.

  1. Ian_Sowell

    Ian_Sowell

    Joined:
    Jul 13, 2022
    Posts:
    5
    I'm trying to use the automatic button navigation with the Input Actions Event System. But I'm also trying to use Screen Space - Camera so that I can apply Post-processing to the UI. But it chooses to navigate to different buttons that are on different canvases. I want it to only navigate to buttons that are on the same canvas/gameObject.
    It works as intended when using Screen Space - Overlay.

    -I have an empty GameObject "UI" with multiple child canvases, each with their different menus.
    -My camera uses the UI layer as it's culling mask, while a different camera has everything else. The projection is Orthographic.
    -I'm navigating with the Default Action Asset/UI.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Pretty sure you would need to not use automatic navigation but instead set up what you want between the
    Selectable
    s on your canvas(es).

    If you are unable to achieve what you want that way, then the last resort would be a script that contains a list of selectables and knows how to switch between them as you like. This would involve turning off all UI navigation and just doing it yourself.
     
  3. Ian_Sowell

    Ian_Sowell

    Joined:
    Jul 13, 2022
    Posts:
    5
    That would be what I would do, if it didn't work for Screen Space - Overlay canvases. Because that leads me to believe that there is some variable that needs to be changed somewhere, otherwise, why would it work?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563