Getting Mouse Position During Drag and Drop UMG

I think it makes sense; if I understood you right, you want to drag&drop a widget onto a 3d world actor. Kind of tricky.

Generally speaking you cannot track cursor position (in a traditional way) during drag operation because the data is not being sent to the controller. You can only obtain cursor position if you are dragging over another widget in which case pointer events return screenspace location - you’ll need to use that instead:

screenp.PNG

The bottom line is: as long as your drop operation ends over a widget, you can get the screen location easily.

You’ll have two options here:

  • the actors have a fully transparent widget attached (updating its screen location during drag&drop - so you’ll end up dropping a widget on a 3d object’s widget; you will not even need a trace here)
  • a fully transparent widget covering the entire screen (or at least the gameplay area), like a border with Tint alpha set to 0 (here you’ll need to trace)

You only need to worry about it while dragging so it can be added/removed (or collapsed) to/from the viewport when dragging starts/ends.

Not sure if any other method exists.