[UI] Designing Inventory Layouts for Cross-Platform Input
Solution
Unity 2021.3.x - Unity 6.3.x
Published Wed, Apr 29
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.
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
SelectableNavigation property to ‘Explicit’ for complex grid layouts to prevent focus errors. - Utilize the
InputSystempackage to dynamically toggle betweenVerticalLayoutGroupandGridLayoutGroupbased on the last used device. - Ensure
RaycastTargetis 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.