[UMG] Drag and Drop Inventory?

Hehe, yeah just ask if you have problems. I was at the same point with DragAndDrop, so i asked and was surprised about Nicks awesome
help, because i couldn’t get any good information about D’n’D before. Might as well write up a small Wiki page for that in the future. :smiley:

See you around (:

ok, hopefully there is only one problem left that I cannot solve…
How to get the position of the dragged Object in OnDrop() or anywhere in C++.
I tried:
1.) MouseCoords give (0,0) while dragging, so no info.
2.) The payload Item is not moved during drag, so no Info.
3.) When creating an Item as ‘Default Drag Visual’ when creating the DragDropOperation and trying to read this Items Position via:

UCanvasPanelSlot* canvasSlot = UWidgetLayoutLibrary::SlotAsCanvasSlot(DefaultDragVisual);
FVector2D mc = canvasSlot->GetPosition();

crash, because there is no canvas slot for that item.
Any ideas?

Solved it!
Found this little Pic, that perfectly illustrates the solution:
http://www.hostingpics.net/viewer.php?id=115791updatewidgetwhiledragging.jpg

THANK YOU!!! That is the picture that I needed for my own issue!

I have been trying to get the mouse coordinates from on drag canceled for a few days now, and didn’t check to see if there was a conversion node beyond GetScreenSpacePosition. I am using Absolute to viewport now though. =D

@Aesais That image link is broken. Do you remember what the solution was for that?