Hi,
I have a pretty conventional menu that i am looking to control with a gamepad, currently using a X-box controller. I have set the input method to KeyboardOrController it works fine on the B button as select but when I press A the menu loses focus and I am stuck.
If i enable the cursor i can move it around to refocus the menu but i don't particularly want to have a visible cursor in the game. It feels like the A button is acting as a left mouse click and as there is nothing underneath i am losing focus. How do i disable this?
Jon
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @jonjojo.
I'm presuming this is a Menu that relies on Unity UI. Are you navigating the menu directly, or using a simulated cursor to hover over items?
What is the "B" button mapped to in Unity's Input Manager? If "Cancel", try unmapping it - the default Unity EventSystem uses this input to cancel selection.
If need be, you can supply a custom Event System prefab at the top of the Menu Manager, though hopefully it shouldn't come to that.
Trying not to use a simulated cursor rather just the controller, it is a unity ui
Thanks you put me onto the correct problem. The button triggers "InteractionB" in OptionalMouseInputModule.cs which in turn fires a right click which causes the menu to lose focus. For the time being i have commented out the InteractionB rightClickStates, i wonder if there is a better solution?
The OptionalMouseInputModule is self-contained, meaning you can duplicate it and modify a copy (rather than the original) to suit your needs.
I'd recommend making a new EventSystem prefab that uses your modified copy, and assigning it at the top of the Menu Manager - AC will then rely on this, rather than the default, for your UI behaviour.