How to Save Items Positions in your Inventory - Top Down Unity 2D #9

Опубликовано: 27 Апрель 2026
на канале: Game Code Library
10,935
272

Saving inventory states is a key feature for 2D games with drag-and-drop systems. In this video, we'll add saving functionality to our inventory, ensuring items stay in the correct slots even after closing the game!

We'll be using the menu and inventoy UI we made in these videos:
   • Menu UI with Tab Switching - Top Down Unit...  
   • Drag and Drop Inventory UI - Top Down Unit...  

And the saving base we made in this video:    • EASY Save System for your Game - Top Down ...  

Code Files:   / inventory-slot-117560971  
Download the Top Down Template🐸: https://gamecodelibrary.itch.io/top-d...

Full Playlist:    • Top Down Tutorial Series - Unity 2D  

Sprite sheet: https://pixel-boy.itch.io/ninja-adven...

All source code for all videos I have made and will make in the future can be found on my Patreon:
  / gamecodelibrary  

If you have any suggestions, feedback or questions, be sure to comment below! Any opinions will help me out on this journey ♡

Check out the full platformer playlist!
   • FULL Platformer Tutorial Series - Unity 2D  

BUY THE COMPLETE PLATFORMER GAME TEMPLATE NOW!!!
https://gamecodelibrary.itch.io/2d-pl...
  / shop  

#unity #gamedev #gamedevelopment #unity2d #topdown

0:00 - Intro
0:30 - Prefabs Folder
0:45 - Item Script
1:36 - ItemDictionary
5:09 - InventorySaveData
5:57 - SaveData
6:19 - InventoryController
8:35 - What does GetSiblingIndex do?
9:15 - InventoryController (continued!)
12:05 - SaveController
13:20 - Initial Test
14:08 - MonoBehaviour Error Fix
14:55 - Script Execution Order
15:58 - Working Test!! :-)
16:14 - Save Data Location and JSON
16:58 - Next Video
17:14 - Outro