Tab Control with Gamepad

Hi there!

I mostly have the Unity input system working with UIS, but I'm having trouble getting the item category to change when I press the controller button on the tab. What's the best way to set this up? The gamepad buttons work fine on items in the inventory, but not the tabs. Let me know if you need any more information.

Thanks!
 
Tabs are not selectable if I remember correctly. Instead I use the "Next" and "Previous" input buttons, by default that should be bound to the triggers "L" "R" on the gamepad.
You can change the input name on the Item Info Grid

1621848426667.png
The tab control field must be set.
 
Thanks for the reply Sangemdoko! The triggers work just fine, as does clicking on the tabs with the mouse. I'm trying to figure out the best way to "click" on them with the gamepad just like how the mouse works. Any ideas? I'm fine to write my own script for it, but not entirely sure how to connect into changing the category when the button is clicked.
 
It really depends how you wish to implement this.
By "clicking" with the gamepad do you mean you have a cursor you control with the gamepad? Or do you wan to select the tab as if it was a button and then click it?

I guess that either way you can implement it by writing a bit of custom code.
The way tabs work is that they change the Filter/Sorter of the Inventory Grid.

I think the simples solution would be to add a button to the existing tab toggles and call the "OnPointerClick" function on the TabToggle component or if you want you can directly use the TabControl and do something around those lines:
Code:
m_TabControl?.SetTabOn(m_TabIndex);

I hope this helps
 
Top