# how do I find out which ui element is under the cursor?

**URL:** <https://forums.unrealengine.com/t/how-do-i-find-out-which-ui-element-is-under-the-cursor/2669033>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [October 27, 2025, 3:07pm UTC](https://forums.unrealengine.com/t/how-do-i-find-out-which-ui-element-is-under-the-cursor/2669033 "2025-10-27T15:07:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![BRGEzedeRocco](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgezederocco/32/1216890_2.png) [@BRGEzedeRocco](https://forums.unrealengine.com/u/BRGEzedeRocco)\
**Post date:** [October 27, 2025, 8:09pm UTC](https://forums.unrealengine.com/t/how-do-i-find-out-which-ui-element-is-under-the-cursor/2669033/4 "2025-10-27T20:09:23Z")

</div>

Okey i understand ,you will need to override the function On Drag Detected

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/6/6f6579cfbd6994963befc76d24d532851dc3cbc1.png)

> [@On a UMG Button, how to handle DragDrop functionality while retaining OnClicked functionality?](https://forums.unrealengine.com/t/on-a-umg-button-how-to-handle-dragdrop-functionality-while-retaining-onclicked-functionality/470375/5):
>
> Thank you both for your quick replies. I ended up using something very similar to Zhi Kang Shao’s solution, but I read both answers and incorporated both of your input into mine. This is what worked for me. The HUD/Grid widget, which is basically just a 12x12 UniformGridPanel of custom buttons: [311612-ue-forum-answer-grid.png] The UniformGridPanel had to be set to Visible in order for OnDrop to work. Also, the custom buttons are all Visible. Everything else is “Not Hit-Testable (Self Onl…

or On Mouse Button Down

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/3/3236f27c421ea5ca08b4866e85b3ab3713819856.png)

> [@Inventory Slot with Click & Drag n Drop functionality](https://forums.unrealengine.com/t/inventory-slot-with-click-drag-n-drop-functionality/2446230/11):
>
> I’d do it like this: Try it, see if that delivers. Do you need to Branch there? Because slot click would be implemented in the Slot widget and trigger on its mouse down.

In this [video](https://www.youtube.com/watch?v=v94b-yp3Umw&list=PL4G2bSPE_8umjCYXbq0v5IoV-Wi_WAxC3&index=10), the process of creating a **drag and swap item system** is explained. I recommend watching the entire series, as it does a great job of breaking down how to build a complete **inventory system** , or you can use it as a reference for what you’ve already created.

This documentation can also help you better understand how the **drag-and-drop system** works in Unreal.

> **[Creating Drag and Drop UI in Unreal Engine | Unreal Engine 5.7 Documentation...](https://dev.epicgames.com/documentation/en-us/unreal-engine/creating-drag-and-drop-ui-in-unreal-engine)**
>
> Shows how you can create drag and droppable UI widgets with UMG.

I think with this, you should be able to achieve what you were looking for.

---

_[View the full topic](https://forums.unrealengine.com/t/how-do-i-find-out-which-ui-element-is-under-the-cursor/2669033)._
