Design Diary: Tile-Based Inventory System #3
Building a Dynamic Tile-Based Inventory System
A core goal of this inventory system was to make interacting with items feel tactile and intuitive, while also ensuring the system could handle complex shapes, rotations, and restricted slots. This required carefully structuring how items are picked up, moved, and placed back into the grid.
Dragging and Placement Logic
When a player picks up an item, the system temporarily removes it from its original grid and handles its movement independently. This enables smooth drag-and-drop interactions while maintaining correct grid logic and placement validation.
Key Feature: Drag Canvas
To prevent collisions and interference with other UI elements or inventory slots, all held items are parented to a dedicated DragCanvas.
- Ensures the item stays visuallt above all other UI components.
- Prevents the original grid from registering interactions while the item is being moved.
- Allows for precise cursor-tracking and snapping behavior.
Separating the held item from the grid ensures that multi-tile and rotated items can be moved freely without breaking the underlying inventory logic.
Key Feature: Continuous Placement Checking
While the item is held, the system constantly evaluates potential placement positions:
- Converts the mouse position into grid coordinates.
- Checks the position against grid bounds, occupied slots, and restricted cells.
- Highlights valid placement tiles in real time.
Real-time feedback for valid vs. invalid placement. Support for rotated, multi-tile items, ensuring rotated shapes respect the grid. Integration with highlighting logic to indicate exactly which tiles the item would occupy
Key Feature: Placement and Drop Logic
Once an item is picked up and moved across the inventory, the system must determine how it behaves when the player attempts to place it back into a grid or drop it entirely. This ensures both tactile control and gameplay consistency, especially for multi-tile and rotated items. After checking whether a slot is valid which is covered in previous design logs, when the placement is invalid the drag and drop system then has thechoice between returning the object to its original slot or dropping the item into the game world as a GameObject instead of a UI component.
1. Returning to Original Slot
If the placement is invalid (overlapping another item or violating grid rules), the system smoothly returns the item to its last valid position where it clears temporary highlights from attempted placement, resets the tile references in the previous grid, and reattaches the item to its original parent grid. This keeps the inventory feeling forgiving yet realistic, encouraging experimentation without punishing mistakes harshly.
2. Dropping Items into the game world
If the player attempts to place an item outside any inventory grid, it is converted into a world object, where a prefab is instantiated at the mouse position in world space ensuring that the item retains its data and appearance for consistency and then the inventory grid is updated to remove references to the dropped item.
Dropping the item into the game world required that I use the resources asset folder

Challenge: Multiple grid support
Since the game features multiple inventory grids (player inventory, machines, interactable containers), the system also needed to handle switching active grids when dragging between containers, updating placement rules dynamically based on the grid and ensuring SavedItems and grid references remain accurate across scene changes.
This was a challenge at first as I was using the individual grid square prefabs to check whether the cursor was over which grid and this made thechanging between grids very finicky as you had to ensure you were selecting the correct location. However, I changed the way that the grid was recognised to get the first child component ItemGrid. This ensured that the reference type was correct while still allowing the parent to control what grid it was.
Supporting multiple grids required careful decoupling of item logic from the grid logic, allowing each item to track its original grid while moving freely. This ensured that if the item was placed in an unavailable spot it would snap back to its previous grid correctly.
Going Solo
What Remains Must Wake
Status | Prototype |
Author | NimueS |
Genre | Platformer |
More posts
- Devlog #314 hours ago
- Design Diary: Character Movement #514 hours ago
- Design Diary: Character Movement #414 hours ago
- Design Diary: Character Movement #314 hours ago
- Design Diary: Character Movement #214 hours ago
- Design Diary: Character Movement #114 hours ago
- Devlog #114 hours ago
- Devlog #214 hours ago
- Design Diary: Tile-Based Inventory System #514 hours ago
- Design Diary: Tile-Based Inventory System #414 hours ago
Leave a comment
Log in with itch.io to leave a comment.