# UMG - Get Mouse Position returns false and nulls

**URL:** <https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [January 28, 2017, 11:39pm UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907 "2017-01-28T23:39:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_3f4ca383](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3f4ca383](https://forums.unrealengine.com/u/anonymous_user_3f4ca383)\
**Post date:** [January 28, 2017, 11:39pm UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/1 "2017-01-28T23:39:34Z")

</div>

Hello,  
I try to retrive controllers mouse position in widgets blueprint like so, but for some reason it returns false and null position. Any ideas why it doesnt work?

 ![3d71d368cc.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/8/e8b8f5e7bbe4d442a410fcfb6d88460fb09f4ef0.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:** [January 28, 2017, 11:44pm UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/2 "2017-01-28T23:44:18Z")

</div>

Try plugging a controller into the target node.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3f4ca383](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3f4ca383](https://forums.unrealengine.com/u/anonymous_user_3f4ca383)\
**Post date:** [January 29, 2017, 12:34am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/3 "2017-01-29T00:34:48Z")

</div>

> [@](#):
>
> Try plugging a controller into the target node.

It’s not possible, Target node takes widget reference. I tried plugging self reference to it, as well as getting player controller from getplayercontroller with index 0. Nothing works.

---

<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:** [January 29, 2017, 1:01am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/4 "2017-01-29T01:01:12Z")

</div>

The node on the _GetMouse_ is kind of misleading, try it like this:

![controller.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/7/4/74332ac6cc380b93be5a5a933c20a71680900130.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3f4ca383](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3f4ca383](https://forums.unrealengine.com/u/anonymous_user_3f4ca383)\
**Post date:** [January 29, 2017, 1:06am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/5 "2017-01-29T01:06:29Z")

</div>

I actually found out that it works in event graph, but not in drag over function. It also stops updating position when I start drag operation. I have no idea why.

---

<div class="post-metadata">

**Author:** ![ste1nar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ste1nar](https://forums.unrealengine.com/u/ste1nar)\
**Post date:** [January 29, 2017, 1:14am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/6 "2017-01-29T01:14:42Z")

</div>

Ah, that explains it… somewhat. I have encountered many bugs related to the drag operation. I suggest you report it on answer hub.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3f4ca383](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3f4ca383](https://forums.unrealengine.com/u/anonymous_user_3f4ca383)\
**Post date:** [January 29, 2017, 1:28am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/7 "2017-01-29T01:28:58Z")

</div>

Okay, so it turns out mouse movement is somehow not tracked during drag operation so I’ll have to figure out way to get correct coordinates from pointer event. Anyway, thanks for suggestions.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_84e009961](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_84e009961](https://forums.unrealengine.com/u/anonymous_user_84e009961)\
**Post date:** [January 29, 2017, 1:49am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/8 "2017-01-29T01:49:12Z")

</div>

When the mouse button is in a clicked down state, mouse position is not tracked. This is seen more easily by creating a 3D widget with a slider and attempting to change the slider with the Widget Interaction Component set on mouse mode.

---

<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:** [January 29, 2017, 2:00am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/9 "2017-01-29T02:00:34Z")

</div>

> [@Aesais;657854](#):
>
> When the mouse button is in a clicked down state, mouse position is not tracked. This is seen more easily by creating a 3D widget with a slider and attempting to change the slider with the Widget Interaction Component set on mouse mode.

It is tracked but not by the controller. Drag movements take over and you should be able to get mouse position data from the pointer event.

---

<div class="post-metadata">

**Author:** ![Valcare](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/valcare/32/937388_2.png) [@Valcare](https://forums.unrealengine.com/u/Valcare)\
**Post date:** [March 15, 2020, 1:08am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/10 "2020-03-15T01:08:55Z")

</div>

> [@](#):
>
> It is tracked but not by the controller. Drag movements take over and you should be able to get mouse position data from the pointer event.

While this allows you from the pointer event to get the screen space position and last screen space position and works perfectly fine in full screen it is horribly askew in windowed.

---

<div class="post-metadata">

**Author:** ![Wabo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wabo](https://forums.unrealengine.com/u/Wabo)\
**Post date:** [February 23, 2024, 1:03am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/11 "2024-02-23T01:03:12Z")

</div>

```auto
FVector2D UUtilityFunctionLibrary::GetMousePosition()
{
	if (UWorld* World = GetGameWorld())
	{
		if (const APlayerController* PlayerController = UGameplayStatics::GetPlayerController(World, 0))
		{
			float X, Y;

			// GetMousePosition does NOT work while Drag and Drop operations are active! Mouse is null during drag. Therefore we have a fallback option below.
			if (PlayerController->GetMousePosition(X, Y))
			{
				const FVector2D PixelPosition = FVector2D(X, Y);

				return PixelPosition;
			}
		}

		const FVector2D MousePositionOnPlatform = UWidgetLayoutLibrary::GetMousePositionOnPlatform();

		FVector2D PixelPosition;
		FVector2D ViewportPosition;
		USlateBlueprintLibrary::AbsoluteToViewport(World, MousePositionOnPlatform, PixelPosition, ViewportPosition);

		return PixelPosition;
	}

	return FVector2D::ZeroVector;
}

```

---

<div class="post-metadata">

**Author:** ![milly-ange](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@milly-ange](https://forums.unrealengine.com/u/milly-ange)\
**Post date:** [August 27, 2026, 11:52am UTC](https://forums.unrealengine.com/t/umg-get-mouse-position-returns-false-and-nulls/83907/12 "2026-08-27T11:52:26Z")

</div>

This  
This was an unexpected find  
A golden nugget when i was drowning with no solution in sight  
Thank you sooooo much it worked !
