Troubleshooting the New Unity Input System Integration

Hi there!

I recently upgraded to 1.1.7, largely to utilize the new Unity Input System integration. Mostly everything seems to be working ok, but I'm running into a few issues I haven't been able to figure out:
  1. The inventory grid is behaving strangely. It's almost as if it doesn't recognize that all of the grid boxes are there. Check out the linked video for an example. Note, this happens whether I'm using a gamepad or the keyboard. In this video, first I'm hitting up and down and it appears to be going on a diagonal, and then I hit right several times and it doesn't seem to go to the last column, or jumps to the next tab. Video Link:
  2. When opening the inventory, I have the exact same function mapped to three different inputs (Gamepad North, PS4 touchpad, and "I" on the keyboard). They all go to exactly the same function that opens the inventory, but all appear to be functioning differently. In the video, the first example is me hitting gamepad North, then "I", then the PS4 touchpad, which is the only one that is working correctly. This worked fine with the new Unity Input system before I upgraded to UIS 1.1.7, so not sure what's messing up here. Video Link:
  3. When I open the hotbar, I can't seem to get the joystick or arrow keys to move through the items. What should I be looking to implement (or fix) to get this working? See attached screenshot.
I realize I may need to provide some additional information of my setup, so let me know what other information I can share to fix up these issues.

Thanks!
 

Attachments

  • Screen Shot 2021-04-24 at 4.35.42 PM.png
    Screen Shot 2021-04-24 at 4.35.42 PM.png
    654.1 KB · Views: 2
1) That's very odd. My guess is that the navigation is messed up. Normally each slot should be pointing to the ones next to it. So maybe the hierachy changed but the naviagation did not.

This is the project I'm working on:
1619428191578.png
You should be able to see those little yellow lines by clicking visualize on a selectable component like the item View Slots
1619428258400.png
the parent of your Item View Slots should have a "Layout Group Navigation" script. You can choose to enable it by toggling "Disabled" off or you can use the Refresh Navigation context item to update it at edit time.
1619428340236.png
In my case I leave it disabled because my item View slots can point to selectables that are not siblings (I point to object outside the grid), so I do not want the navigation to change on awake.


2)
I'm not sure what could be going on here. If all inputs are pointing to the same button they should work the same way. Perhaps there are issues with the input itself. Try adding a Debug.Log() in the code that opens the inventory menu. Perhaps the input gets pressed twice instead of once (some other users reported having issues with double inputs, but that was mostly with the normal input system. One user said they had double inputs with the new input system with they set the time scale to 0, perhaps you have the same issue?)

3)
When you open the Hotbar, what components to you use? If you are using a Display Panel with a "ItemViewSlotsContainerPanelBinding" you could toggle on the option to select a slot on open in the inspector

Or if you want you can do it in code using:
Code:
m_ItemViewSlotContainer.SelectSlot(slotIndex);
You can learn more here:

I hope that helps
 
Thanks so much Sangemdoko! That all totally helped out. Somehow the navigation order got messed up and I forgot to check it.

Regarding #2, I was able to get the "i" key working by removing the Open Toggle Input from the Display Panel Manager Handler on the main Inventory Canvas. Not exactly sure why that fixed it.
Screen Shot 2021-04-26 at 9.07.52 PM.png

Regarding the North button the gamepad, I haven't been able to figure it out. The button isn't being called twice. I decided to map button East and that worked perfectly fine. I looked through all the code and I'm not using button North anywhere else (and it isn't in my new Unity input system action mapping either). Any other ideas?

Thanks!
 
That's very odd. I can't think of any reason for the North button to behave differently from any other input. Try changing the Button Action Name to see if that works, but I don't really see any reason it would.
I'm sorry I can't be of more help
 
I had a simmilar problem with the navigation seemingly off when using a grid of 5x4.

The navigation looked correct:
1620651932744.png

After some digging, I found that the axes for selecting the next/previous row or column seemed to be mixed up in GridNavigator.cs.
After swapping Axis.Horizontal to Axis.Vertical it all worked flawlessly:
1620658303956.png

Now the real question is if the system had a bug, or if i set it up incorrectly ;)
 
Hi Tzirrit,
Good job on figuring what you problem was. That being said, I don't think the code was wrong before.
Horizontal means left <-> right which should move in the columns.
Vertical means down <-> up which should move in the rows.

Instead of changing the code, have you tried to change the GridLayoutGroup Axis?
1620716879026.png

Let me know if that works
 
Yes, I have changed the axis, as well as the dimensions - to no avail. The only effect was the navigation being "off" along the other axis.


The only change that did solve my issue was chaning the code. So even if it was not a bug, the change seems to work now in my scenario...
 
I'm dealing with similar issues using Unity Input System (instead of old manager) with the UIS integration.

I want to navigate between panels in the Storage menu example using a gamepad input. I am able to navigate the Inventory grid but not move over to Storage. I see that it's not configured in the explicit navigation.

Is there something in the system that resets the navigation on entering playmode? I just manually reconfigured the navigation to move between the "Inventory" and "Storage" panels and when I enter playmode it overwrites the settings and resets them to none, including when I exit playmode. Thanks!
 
Figured it out. By setting the Disable Flag To True in the Layout Group Navigation component and then setting all the items Navigation to "Everything" instead of "Explicit" the controller can now move fluidly between both the "options" and "item grid" areas.
 
Top