How to make drag and drop inventory click-able

So try this: On Clicked it attaches to cursor, sets something (bIsIconAttached) to True. Which allows you to move the icon wherever but not allow it to fall. On left click again, it will see if something is attached, if something is attached, then it will drop it at that location. You can use state machines if that makes it easier, whatever. But that’s all there is to it really. Just checking to see if the icon is attached and then when you click again, if it is, then it drops it wherever.

Hey community,

I am trying to figure out how to make it so when you click an item in your inventory, it sticks to your cursor and then you click again to deposit it somewhere. Right now my drag and drop inventory is simply what the names states, you click an item and drag it, meaning you have to hold the left mouse button down. I am trying to figure out a way around this by simply clicking the item, and with it selected you click again, for example on an equipment slot to start wearing it. Any guidance on how I could create this type of interaction would be greatly appreciated!

Thanks for any help!

You will actually have to create the system yourself. Pretty much it would be on tick, adjusting to the mouse cursors position in realtime. Try by coverting mouse location to world space. get mouse position might work also. But anyway, all you are doing is moving the icon wherever the mouse cursor is.

I understand the boolean portion but what functions do I use to capture the mouse without having to hold down the mouse button? Right now I have a OnMouseButtonDown function which detects if LMB is pressed, and then a OnDragDetected which will create a drag drop operation and position the image of the item on the mouse cursor. I can’t figure out how to create the drag drop operation and keep its visual on the cursor without having to actually hold and drag the item.