Drag items problem [solved]

I have enabled "drag" of items from inventory, the invontory interface is transparent and is top of the scene, so when I put the mouse cursor on top of an item and hold down the mouse button the "coin" interface will popup because it detects the mouse hold down event so instead of dragging the coin interface pops up, if I let go of the mouse button the draggable image is there.

Is there a way to avoid the mouse hold down event to trigger if I am over an inventory item in some way ?

Newbie

13 Posts

Dragging doesn't actually occur by holding down the mouse button & dragging, it works by left clicking & releasing over the item you want to drag. The term dragging is misleading, as in this case it just means that you are setting the mouse cursor to the same image as the item as if you are actually dragging it around.

If you want to actually drag an item around in the way you want it to work, then you will need to create a custom system with scripting that will allow you to do that.

Newbie

13 Posts

Another question related to the drag function, if I pick up an item from the inventory, is there some way I can "cancel" it if I change my mind, does not look like there is, once it is picked up it has to be dropped somewhere ?

Newbie

13 Posts

right click should cancel the item & switch back to the default command providing you assigned one in the properties section of the main command interface you should have created - if it's not working then you could create some action parts inside of the global right click action under mouse properties in the main game settings section of the editor.

This is the code in the script block...

if not game.UsedItem:isEmpty() then return trueelse return falseend

12345

The code checks if an item is currently held & returns true or false depending on the query. if it's true then the action parts shown in the screenshot are for setting the item in hand to empty & setting the current command back to the default command.