v1.86.0
Unity 2022.3.57f1
I'm trying to set up navigating menus with the keyboard/gamepad but I'm running into problems with the cursor overriding selections.
Images are all my settings. I'm using the Pause menu to test. I have "directly navigate when paused" checked.
Event System: https://drive.google.com/file/d/1u_RJDzEQFKSeGZKY8qHzajGSEjYkO5u4/view?usp=sharing
Menu Manager: https://drive.google.com/file/d/19O6TR6XDHtJPsTBxcKZwUpVVdCbQ58Lz/view?usp=sharing
Settings Manager: https://drive.google.com/file/d/1MTJRfgIWAkGf8I36xNSsLB8MHCO4Wifo/view?usp=sharing
Scenario 1: Using mouse and keyboard. I press escape to bring up the pause menu. For a split second I can see the first element highlighted before it un-highlights. I assume this is because the mouse is off to the side and the mouse overrides navigation.
Scenario 2: I switch to using my gamepad. I can see in the instantiated event system that the input switched to my gamepad. When I press start it brings up the pause menu but the middle element (Save) is permanently selected. I assume this is because the cursor gets locked to the center of the screen and it automatically highlights save. I can't navigate the menu with my gamepad because of this.
Scenario 3: I disable "use simulated cursor for UI events." I can now navigate the menu with keyboard/gamepad but I can't select anything with the mouse.
Question: I want to be able to select elements while in mouse + keyboard mode but when I switch to a controller I need to be able to navigate without the mouse.
Bonus question: Is there a way to either prevent menu elements from being deselected when the cursor isn't highlighting them (basically an element should be highlighted at all times) or a way to disable only the mouse at run-time?
I can write my own actions and edit scripts I just want to sort out what AC handles natively and what I need to customize.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The behaviour it sounds like you're expecting ought to be the behaviour you get.
If a Menu is set to be directly-navigable, then the mouse shouldn't factor in, the first element should remain auto-selected, and then navigable with the keyboard or gamepad (depending on Input Method).
The "Simulated Cursor" should only factor in if you use keyboard or controller input to navigate the Menu that is not directly-navigable. In this case, the cursor is used but moved through these inputs and not with the mouse.
The only issue I can recreate is that the mouse will affect the highlighting of whichever element it appears over, such that both that and the first element appear selected, but it doesn't affect the ability to navigate directly. I'll look into this, but your Scenario 1 and 2 specifically shouldn't be occurring.
As you're dealing with two control schemes, try temporarily unchecking the Auto Sync Control Scheme option so that your Input method remains as Mouse And Keyboard. Putting the Gamepad aside for the moment, does Scenario 1 still occur?
I wonder if your wider issues are related to your Unity version, which also affects which version of the Input System package is available.
In a backup/test project, see if these issues occur in a later release, Unity 6.3 or 6.4.
Updated to 6.3 and AC 1.86.4 still experiencing the same behavior.
I disable Auto Sync Control Scheme. Scenario 1 still occurs.
I'm going to create a fresh project to help troubleshoot.
Started fresh project. Loaded the 3D game demo. I enable all the directly control toggles which are disabled by default in the demo. I can navigate all menus with the keyboard but checking these options disables mouse navigation of the menu elements. Left click selects the highlighted element.
I noticed in the manual screenshot for navigating menus directly (page 415) there's a toggle under global menu settings for "Disable mouse when directly-controlling Unity UI Menus?." It's not present in the current version of AC. Is this option enabled or disabled by default?