When drag and drop operation created, visual widget fly from top left corner of draggable widget to current mouse position instead of immediately appear at mouse position.
I think, it happened because screen position of base widget used instead of mouse position.
I ran into a similar issue, and the cause ended up being that I was creating the DragDropOperation from a parent widget that contained the thing I actually wanted to drag.
If you read through the code:
SObjectWidget::OnDragDetected
FUMGDragDropOp::New
FUMGDragDropOp::OnDragged
the assumption appears to be that the widget generating the UDragDropOperation in the OnDragDetected() handler is the thing that is going to be dragged.
In OnDragged() you can see the animation logic, and as you noticed, StartingScreenPos will be set to MyGeometry.AbsolutePosition of the SObjectWidget that created the DragDropOp in the OnDragDetected() handler.
My solution was create a simple wrapper widget that connects the draggable children with the parent widget so they can share info about which sub-widget is being dragged, and to coordinate the payload passed to CreateDragDropOperation for later use in OnDrop
Time and time again I’m coming back to this issue of not being able to set up StartingDrageePosition. I found a hilariously simple workaround:
Create a Dragged Visual widget and in its Construct play the following animation:
Track [[this]] object Render Opacity, start with 0 and after 0.150 seconds set Render Opacity to 1. This will hide the slide animation and widget will appear already at mouse cursor.
Make sure your Pivot is “Center Center”.