Uploaded March 2021 | Updated November 2026, 2 hours ago
In this Godot tutorial, I will teach you how to make stackable items in your inventory. With this code, you will have the flexibility to determine which items should be stackable and which items are non-stackable. The code will be fully integrated into the drag & drop inventory code from the last tutorial. In the next tutorial, we will work on stack splitting.
Tutorials for both UI panels:
Character Screen:
youtu.be/lwTPlnW1qhA
Inventory Panel:
youtu.be/lrAwX2t1mGY
Drag & Drop functionality:
youtu.be/dZYlwmBCziM
0:00 Intro
0:15 Updating Data Structures
1:25 Stack Label
2:52 Loading Inventory with Stacks
4:01 Including Stacks in Drag and Drop
9:30 Stacking Functionality
11:37 Demo
12:03 Outro
⬧⬧⬧⬧⬧ GDC TUTORIALS ⬧⬧⬧⬧⬧
I believe educational material should be available to all, for free
Support this vision by joining the GDC-Club and get perks in return
MEMBERS ►►youtube.com/c/gamedevelopmentcenter/join
PATREON ►►patreon.com/gamedevelopmentcenter
⬧⬧⬧⬧⬧ LEARN MORE GAMEDEV ⬧⬧⬧⬧⬧
These books have helped me in my game design and programming, I whole fully recommend them to you!
Level Up! The Guide to Great Video Game Design ►► amzn.to/3hIg6dE
Game Programming Patterns ►► amzn.to/35IoDsH
The Art of Game Design: A Book of Lenses ►► amzn.to/35MSHoU
⬧⬧⬧⬧⬧ LIVESTREAMS ⬧⬧⬧⬧⬧
I Livestream game development twice a week right here on YouTube.
Subscribe and hit that Bell Icon to make sure you don't miss it!
youtube.com/c/GameDevelopmentCenter?sub_confirmation=1
Tuesday and Thursday
1900 to 2200 (GMT+1/2 (winter/summertime), that's;
1200 to 1500 (PST), or
1500 to 1800 (EST).
⬧⬧⬧⬧⬧ COMMUNITY & SOCIAL ⬧⬧⬧⬧⬧
Join the community! Follow me on Social!
DISCORD ►► discord.gg/DwcFXyS
TWITTER ►► twitter.com/GamedevStefan
⬧⬧⬧⬧⬧ ASSETS USED ⬧⬧⬧⬧⬧
UI asset pack ►► assetstore.unity.com/packages/2d/gui/classic-rpg-gui-160253?aid=1101leLEi
4000 Icons Pack ►► assetstore.unity.com/packages/2d/gui/icons/4000-fantasy-icons-163280?aid=1101leLEi
Chocolate Cake Icon by KAdala
⬧⬧⬧⬧⬧ ABOUT GDC ⬧⬧⬧⬧⬧
GDC, Game Development Center, was created to provide in-depth tutorials on game design theory and game development using the Godot Game Engine. I aim for multi-part Godot tutorials, allowing me to dive deeper into Godot's features.
⬧⬧⬧⬧⬧ DISCLAIMER ⬧⬧⬧⬧⬧
Some of these links go to one of my websites and some are affiliate links where I'll earn a small commission if you make a purchase at no additional cost or disadvantage to you. You will receive the same price and service.
In this Godot tutorial, I will teach you how to make stackable items in your inventory. With this code, you will have the flexibility to determine which items should be stackable and which items are non-stackable. The code will be fully integrated into the drag & drop inventory code from the last tutorial. In the next tutorial, we will work on stack splitting.
Tutorials for both UI panels:
Character Screen:
youtu.be/lwTPlnW1qhA
Inventory Panel:
youtu.be/lrAwX2t1mGY
Drag & Drop functionality:
youtu.be/dZYlwmBCziM
0:00 Intro
0:15 Updating Data Structures
1:25 Stack Label
2:52 Loading Inventory with Stacks
4:01 Including Stacks in Drag and Drop
9:30 Stacking Functionality
11:37 Demo
12:03 Outro
⬧⬧⬧⬧⬧ GDC TUTORIALS ⬧⬧⬧⬧⬧
I believe educational material should be available to all, for free
Support this vision by joining the GDC-Club and get perks in return
MEMBERS ►►youtube.com/c/gamedevelopmentcenter/join
PATREON ►►patreon.com/gamedevelopmentcenter
⬧⬧⬧⬧⬧ LEARN MORE GAMEDEV ⬧⬧⬧⬧⬧
These books have helped me in my game design and programming, I whole fully recommend them to you!
Level Up! The Guide to Great Video Game Design ►► amzn.to/3hIg6dE
Game Programming Patterns ►► amzn.to/35IoDsH
The Art of Game Design: A Book of Lenses ►► amzn.to/35MSHoU
⬧⬧⬧⬧⬧ LIVESTREAMS ⬧⬧⬧⬧⬧
I Livestream game development twice a week right here on YouTube.
Subscribe and hit that Bell Icon to make sure you don't miss it!
youtube.com/c/GameDevelopmentCenter?sub_confirmation=1
Tuesday and Thursday
1900 to 2200 (GMT+1/2 (winter/summertime), that's;
1200 to 1500 (PST), or
1500 to 1800 (EST).
⬧⬧⬧⬧⬧ COMMUNITY & SOCIAL ⬧⬧⬧⬧⬧
Join the community! Follow me on Social!
DISCORD ►► discord.gg/DwcFXyS
TWITTER ►► twitter.com/GamedevStefan
⬧⬧⬧⬧⬧ ASSETS USED ⬧⬧⬧⬧⬧
UI asset pack ►► assetstore.unity.com/packages/2d/gui/classic-rpg-gui-160253?aid=1101leLEi
4000 Icons Pack ►► assetstore.unity.com/packages/2d/gui/icons/4000-fantasy-icons-163280?aid=1101leLEi
Chocolate Cake Icon by KAdala
⬧⬧⬧⬧⬧ ABOUT GDC ⬧⬧⬧⬧⬧
GDC, Game Development Center, was created to provide in-depth tutorials on game design theory and game development using the Godot Game Engine. I aim for multi-part Godot tutorials, allowing me to dive deeper into Godot's features.
⬧⬧⬧⬧⬧ DISCLAIMER ⬧⬧⬧⬧⬧
Some of these links go to one of my websites and some are affiliate links where I'll earn a small commission if you make a purchase at no additional cost or disadvantage to you. You will receive the same price and service.






![Enemy AI, Return to Position [Godot 3.2] | The Enemy Logic Series #4
In this Godot tutorial, we expand our enemy logic AI and make sure the enemy returns to its starting position if it cant find the player.
00:00 Intro
00:56 Saving the Starting Position
02:16 Coding the State Machine Return
06:07 Building a Return function
10:40 Adding some extra smoothness
Many games have a feature in which enemies return to their guard or patrol routines if the player has hidden from them long enough. In this Godot 3.2 tutorial, we will do just that. We make sure that after the enemy has searched for the player, it waits around for a few seconds before it return to position.
⬧⬧⬧⬧⬧ GDC TUTORIALS ⬧⬧⬧⬧⬧
I believe educational material should be available to all, for free
Support this vision by joining the GDC-Club and get perks in return
https://www.youtube.com/c/gamedevelopmentcenter/join
https://www.patreon.com/gamedevelopmentcenter
⬧⬧⬧⬧⬧ LEARN MORE GAMEDEV ⬧⬧⬧⬧⬧
These books have helped me in my game design and programming, I whole fully recommend them to you!
Level Up! The Guide to Great Video Game Design ►► https://amzn.to/3hIg6dE
Game Programming Patterns ►► https://amzn.to/35IoDsH
The Art of Game Design: A Book of Lenses ►► https://amzn.to/35MSHoU
⬧⬧⬧⬧⬧ LIVESTREAMS ⬧⬧⬧⬧⬧
I Livestream game development twice a week right here on YouTube.
Subscribe and hit that Bell Icon to make sure you dont miss it!
https://www.youtube.com/c/GameDevelopmentCenter?sub_confirmation=1
Tuesday and Thursday
1900 to 2200 (GMT+1/2 (winter/summertime), thats;
1200 to 1500 (PST), or
1500 to 1800 (EST).
⬧⬧⬧⬧⬧ COMMUNITY & SOCIAL ⬧⬧⬧⬧⬧
Join the community! Follow me on Social!
DISCORD ►► https://discord.gg/DwcFXyS
TWITTER ►► https://twitter.com/GamedevStefan
⬧⬧⬧⬧⬧ ABOUT GDC ⬧⬧⬧⬧⬧
GDC, Game Development Center, was created to provide in-depth tutorials on game design theory and game development using the Godot Game Engine. I aim for multi-part Godot tutorials, allowing me to dive deeper into Godots features.
⬧⬧⬧⬧⬧ ASSETS USED ⬧⬧⬧⬧⬧
https://www.kenney.nl/assets/isometric-dungeon-tiles
https://opengameart.org/content/flare-skeleton-mod-skeletal-occultist
https://opengameart.org/content/flare-skeleton-mod-skeletal-knight
https://opengameart.org/content/icicle-spell
⬧⬧⬧⬧⬧ DISCLAIMER ⬧⬧⬧⬧⬧
Some of these links go to one of my websites and some are affiliate links where Ill earn a small commission if you make a purchase at no additional cost or disadvantage to you. You will receive the same price and service. Enemy AI, Return to Position [Godot 3.2] | The Enemy Logic Series #4](https://i.ytimg.com/vi/gS82DdNUbFc/mqdefault.jpg)



