# Getting mouse location in UMG

**URL:** <https://forums.unrealengine.com/t/getting-mouse-location-in-umg/594940>\
**Category:** UI\
**Tags:** unreal-engine, UMG\
**Created:** [July 1, 2022, 2:01pm UTC](https://forums.unrealengine.com/t/getting-mouse-location-in-umg/594940 "2022-07-01T14:01:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 1, 2022, 2:58pm UTC](https://forums.unrealengine.com/t/getting-mouse-location-in-umg/594940/2 "2022-07-01T14:58:30Z")

</div>

You will need to use widget geometry for this, otherwise it’s going to get really ugly.

> [@How can I manipulate world location through a minimap widget?](https://forums.unrealengine.com/t/how-can-i-manipulate-world-location-through-a-minimap-widget/469190/2):
>
> You can detect clicking on the world map by putting a clear widget button on top of it, and then detecting the cursor location on click. (remember to zero out the alpha on all the button images Normal, Highlight, Pressed, etc.) Then to drag you’ll need to use the Drag and Drop system built-in to Unreal. It has parameters to clip your object within the bounds of the map, drag the object around responsively, and then detect when it is dropped. There is a problem you’ll need to work around to have …

The mouse event spits out screen space, too - you translated it into the local coordinates of the widget (you may need to do it more than once if you have a nested hierarchy - windows inside windows…)

Once you have local coords and know world coords → MapRange is your friend.

* * *

> Anyway, I’m not overriding the mouse functions as I’m using Input Actions instead,

Perhaps you could explain the reasoning behind this choice. Sometimes there is a good one, other times it’s a dead end. Widgets are fine with processing input and this produces the necessary data for a lot of operations.

---

_[View the full topic](https://forums.unrealengine.com/t/getting-mouse-location-in-umg/594940)._
