# How to directly execute OnDragDetected?

**URL:** <https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991>\
**Category:** UI\
**Tags:** drag, drag-and-drop, unreal-engine, mouse-event, UI\
**Created:** [August 24, 2026, 4:33am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991 "2026-08-24T04:33:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 24, 2026, 4:33am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/1 "2026-08-24T04:33:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 24, 2026, 6:25am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/2 "2026-08-24T06:25:31Z")

</div>

> [@SemanticRain619](#):
>
> DetectDragIfPressed isn’t executing OnDragDetected at all

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.

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 24, 2026, 7:15am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/3 "2026-08-24T07:15:37Z")

</div>

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.

 ![SS1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/0/81028a7b9c574a3521ece6837c2dce291ffa379c.png)

 ![SS2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/4/4c400260baf63fa6f02a5a6dbeac6d73a72a2bf5.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 24, 2026, 7:05pm UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/4 "2026-08-24T19:05:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 25, 2026, 12:37am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/5 "2026-08-25T00:37:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 25, 2026, 6:53am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/6 "2026-08-25T06:53:44Z")

</div>

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.

 ![SS3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/3/3/4330cfbd2150842a64a3531956d502ef5095b0d5.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 25, 2026, 6:54pm UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/7 "2026-08-25T18:54:24Z")

</div>

> [@SemanticRain619](#):
>
> Since the left-click cannot be used for the drag key, I am using a branch as a substitute

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

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

---

<div class="post-metadata">

**Author:** ![SemanticRain619](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SemanticRain619](https://forums.unrealengine.com/u/SemanticRain619)\
**Post date:** [August 26, 2026, 3:14am UTC](https://forums.unrealengine.com/t/how-to-directly-execute-ondragdetected/2745991/8 "2026-08-26T03:14:34Z")

</div>

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