when I move an item to a different slot in the inventory it disappears from the hotbar

As the title says, I’m struggling with a hotbar system. When I put an item into the hotbar and then change it’s slot in the inventory the item is removed from the hotbar. I know this means that it’s reading the inventory slot rather than the item ID but how do I fix this?
Any help is appreciated and will post screenshots of blueprints if needed!

Split your problem into separate tasks:

  • make custom widget that displays just single item (if from array make it display array item from index)
  • make some widget that loads, removes and swaps those above widgets, ie. inventory widget (whole inventory)
  • and finally in player controller, character or hud (or whatever will manage inventory), make inventory manager that keeps array of structs or whatever you pick to manage DATA behind inventory

then (longer descriptions):
for single item widget, make it only to display, collapse, change hover over etc tasks

for inventory widget, make it track changes in DATA for inventory (event dispatcher), then tell single items widgets that something changed (either custom events of functions in single widget)

and for inventory manager, well it all depends what type of inventory you want. However for first prototype i would just make it list with numbers of items limit. And maybe some 2-3 ways of sorting (just for fun, as sorting would require some way to rearrange whole inventory, tell all widgets it changed etc.)

I already have a fully working inventory. It’s just this one small problem of the hotbar reading a specific spot rather than the item placed in it. All other parts of the hotbar work other than that one thing. I’ve been following a tutorial on YouTube by Ryan Laley but this is one bug that he just doesn’t check for and thus doesn’t fix