How to directly execute OnDragDetected?

I’m looking for an alternative because DetectDragIfPressed isn’t executing OnDragDetected at all.

Please tell me how to directly execute OnDragDetected from a mouse event or a button click event.

Perhaps you could demonstrate what and how you’re doing it? Because dragging generally works well enough; there are certain scenarios where dragging gets iffy, though - like attempting to drag actual buttons, for example.

Even if I tried to explain it in detail, that is really all there is to it, so there isn’t much to say.

I am executing DetectDragIfPressed using mouse events on a widget derived from a User Widget. The widget has a simple configuration consisting only of an image set to “Visible,” and mouse events are executing without issues.

As I understand it, attempting to drag in this state should trigger OnDragDetected, but that never happens. It may occasionally be possible, but it will stop working after restarting the editor.

I tried several mouse events—specifically OnMouseMove, OnMouseButtonDown, and OnPreviewMouseButtonDown—but the results were the same, so I do not believe the issue lies there.

Also, I am using Common UI, but I am not using it for this drag widget.

I’m not sure if this will be helpful, but I’ve attached a screenshot just in case.

The above is not set up correctly. On Drag Detected → Detect Drag if Pressed. Also, you’re missing the drag key.

What is incorrect? It is correct to implement Detect Drag if Pressed within the mouse event.

Since the left-click cannot be used for the drag key, I am using a branch as a substitute. It will still function normally.

Oh gosh, finally! The other drag function worked. DetectDragIfPressed is a trap.

This wasn’t mentioned in any of the documentation, and it made me waste a lot of time.

Why would you say that? You’re not even choosing the key from the drop down… :person_shrugging: As above:

It’s just: On Drag Detected → Detect Drag if Pressed

I said that because it didn’t work. These screenshots are just one example of the countless methods I tried.