Hello everyone and have a nice weekend!
I’ve created a inventory system using this awesome tutorials:
Everything works fine, when i pick up item it shows in inventory menu, i can move it around.
However, there is a huge unfinished issue that i’m trying to fix for 2 weeks (yeeek! :(). When i grab an item in inventory and move it to another slot it
works. But when i grab empy slot and move it to the one in use, it changes position too, like i was grabing an item (and i wasnt!). Then i got an error
because bp wants to cast item texture to mouse cursor but there is no texture 'cause there is no item!
What im trying to achieve but dont know how to start, how to tell bp when i hover mouse over a hitbox (slot) it sees “Is item there?” and if it is "What is
his name?".
Any wonderful tips where to implement that? My brain is melting and i dont know where to bite this anymore… :’(
This are my BP.
First of all, in HUD in a Draw Inventory function im setting up Inventory variable (based on BaseItemPlaceHolder) like this,
and based on that “Set Current Inventory Index” im adding hitboxe names. It work ellegant, when i hover over empty slot it shows number from 0 to 37 (in my case):
This is “Send Item” event in BaseItemPlaceHolder BP:
This is Add Item in MyCharacter:
And this sets interactions to hitboxes (slots) with mouse:
Ive got also problem when with item highlighting. There is a separate texture for highlighting. It shows up when i hover cursor over slot, but every slot, not just the one in use. But for that ive got an idea how to fix it. I only need this information about item in the slot.
In what “direction” should i look? I’ll be much appreciated for any help.