UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

ui

[UI] Designing Inventory Layouts for Cross-Platform Input

Solution

uguiinputlayoutresponsive designuser experience

Unity 2021.3.x - Unity 6.3.x

Published Wed, Apr 29

Issue

 The selection of an appropriate inventory user interface presents a common design challenge. This decision is complexified by the need to accommodate various user input methods such as controllers and mouse-and-keyboard while maintaining consistent Navigation.

Optimal inventory UI design depends on target input devices. List layouts facilitate Navigation for controllers, whereas grid-based drag-and-drop systems suit mouse interactions.

Explanation

The primary input method is considered the foundational constraint for UI Navigation. List layouts are traditionally more effective for Navigation when using game controllers due to their linear, sequential nature. Conversely, grid-based systems utilizing GridLayoutGroup are typically better suited for mouse and keyboard input, providing tactile interaction for item manipulation via a pointer interaction.

Extensive use of drag-and-drop interactions can shift focus from core gameplay to inventory management itself. Incorporating search strings via a TMP_InputField enhances usability for both layout types. For enhanced Navigation across multiple input types, paged lists or tabbed interfaces are often preferable to continuous ScrollRect movement. These methods provide discrete Navigation points that are manageable with both keyboard and gamepad inputs, minimizing imprecise scrolling.

Additional Tips

  • Configure the Selectable Navigation property to ‘Explicit’ for complex grid layouts to prevent focus errors.
  • Utilize the InputSystem package to dynamically toggle between VerticalLayoutGroup and GridLayoutGroup based on the last used device.
  • Ensure RaycastTarget is disabled on non-interactive UI overlays to avoid breaking Navigation focus.

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.