Prototype Inventory Controls and Avatar Color Swatches
Build a flexible inventory selector and a visible customization station for desktop and touch players.
Treat the hotbar as selection state
Create four UI buttons and bind number keys to the same selection function used by button activation. Show the selected slot with a highlight. Skip key inputs Roblox has already processed so typing into chat does not change the selection. Let an item-use handler verify ownership on the server.
Use the world for color options
Place a few colorful anchored parts and give each an interaction prompt. Read the selected color from the prompt's actual swatch on the server. Apply it only to the current character. Test with your intended avatar type, as clothing can cover the colored body part.
Check the mobile layout
Use Studio device emulation, tap each hotbar slot and confirm selection is visible. Walk through the swatch display from different camera angles. Move labels or rearrange the swatches if the prompts overlap.
Start with a selection prototype
Open a blank test place and create a broad dressing room with a clear path between its stations. Add the hotbar LocalScript and leave actual items out of the first test. You want to see four slots, one visible selection and no other behavior when the player chooses a slot. Put the row low enough to keep it near the player's controls, with enough space that it does not intrude on the built-in jump or chat interface. Use a short label or number on each button to confirm ordering. Before deciding the final artwork, test whether you can comfortably reach each slot on a small device preview.
Make input methods share one selection function
The hotbar has two ways to select a slot. A GUI button can be clicked or tapped, and a number key can choose the same slot from a keyboard. Send both through a function that records the selected index and updates every button's appearance. That function is a cleaner place to define valid indices and selection feedback than duplicating the rule in each handler. When handling keyboard input, pay attention to whether another control has already consumed it. Test by typing numbers in chat, closing the chat box and typing the same numbers again. The selection should only change when the shortcut is intended for the hotbar.
Connect an inventory without trusting the highlight
A highlight tells the player what they selected. It does not establish that the player owns an item or has permission to use it. If you connect a server inventory later, ask the server to validate the action against the actual equipped item and ownership. Keep item identifiers and slot labels separate. A player can rearrange their slots in the interface without changing what the item is on the server. For a first integration, let the local selector read a list of owned items and display their labels. Test the read-only view before adding an action that can consume an item, alter an avatar or change another player.
Give avatar colors a physical interaction
Place three anchored parts under ColorSwatches and set their colors in Studio. Put enough space between them that the prompts are easy to choose. The server should read the color from the swatch selected by the player and apply it to the current character's BodyColors. Compare at least two rig and clothing combinations. A shirt or surface accessory can cover the torso's new color even when BodyColors is updating correctly. If a valid avatar does not have the instance your demo expects, check its hierarchy before adding a fallback. Treat the color picker as a specific player action, so one visitor's change does not affect the whole dressing room.
Bring the two controls together in a test
Invite two local clients and have them choose different hotbar slots. Ask one player to use the red swatch while the other stays next to the green swatch. Check that the hotbar highlight and character color both remain personal. Reset one character and decide whether the slot choice and color should persist in the current visit. A persistent local GUI can retain its selection, while a new character can start with its usual appearance unless the server reapplies the saved color. Write down what happens when the avatar resets before you introduce persistence. Run the same route on a phone viewport and look for overlapping prompts, cramped buttons, or colors that are difficult to tell apart.