Inventory System Troubles - Dropping Items Not Working (visual references provided)

How do I…?

How do I get stackable items to be dragged out of the inventory and dropped next to the player AND pick items back up without them overlapping in the inventory (see below screenshot)? For transparency/reference, I followed this tutorial, but had to deviate a bit because I wanted items to be draggable: https://www.youtube.com/watch?v=jdVgieW4L6k

What is the expected result?

I want to be able to pick up both stackable and non-stackable items, and drop them outside of the inventory (near the player). I would also like to be able to move items around within the inventory and discard items, but that’s a challenge for a different day…

What is the actual result?

[A video of the issue will follow]
Picking up stackable and non-stackable items works fine, and dropping non-stackable items works as intended. HOWEVER, when I click a stackable item within the inventory, it splits the items in a weird way (placing a copy in the first inventory slot) and when the LMB is released four (4) things happen: the item count doesn’t decrease, the item stays wherever the mouse is, it’s still draggable, and it follows the PC… Additionally, when I re-pick up an item, it goes into the first inventory slot even if that slot is full…

ScreenRecording2025-03-24162423

Related screenshots

Here are the screenshots of the relevant events (note: you’ll see that I added comments in the events for myself so that I can remember/understand what for future reference - hopefully this will help you as well):



Thank you all very much in advance! If you need any more references, please let me know!

[Yay! My post is back!]

So, I’m not really sure how to edit my original post to update it, so I guess I’ll put the update in a reply? I apologize if this is the incorrect way of doing things…

With the advice of ZeroX4 on the Discord server, I made some changes in my events, but my issues still persist (and I discovered a new issue, woohoo…) :smiling_face_with_tear:

Changes I made (screenshots below):

  1. Switched to using the NOT condition instead of inverting conditions.
  2. Removed the AND condition in one of my events since it was redundant.
  3. Changed Player.BoundingBoxCenterX() to simply Player.CenterX() - can’t remember if that was something I picked up from the tutorial I watched or not.

New Issue (GIF below):
I realized that the items are draggable outside of the inventory (even when it’s not open), and I don’t want that to happen either…

Side note:
I’ve found a different tutorial, so I’ll see if that will help me. But in the meantime, I’m posting this here just in case. Thank you for any help that you can provide!

(P.S: I don’t think I need to but, also just in case, the assets I’m using aren’t mine. The character is by PixiVan on itch.io and the items are from the Gdevelop asset store - just wanted to be transparent about that since I didn’t think to mention that in my main post.)



ScreenRecording2025-03-25111645